Rev | Line | |
---|
[17] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
[258] | 3 | # Copyright 2016 Christian 'Alloc' Illy
|
---|
| 4 | #
|
---|
| 5 | # Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 6 | # you may not use this file except in compliance with the License.
|
---|
| 7 | # You may obtain a copy of the License at
|
---|
| 8 | #
|
---|
| 9 | # http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 10 | #
|
---|
| 11 | # Unless required by applicable law or agreed to in writing, software
|
---|
| 12 | # distributed under the License is distributed on an "AS IS" BASIS,
|
---|
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
| 14 | # See the License for the specific language governing permissions and
|
---|
| 15 | # limitations under the License.
|
---|
| 16 |
|
---|
| 17 |
|
---|
[17] | 18 | genericHelp() {
|
---|
| 19 | line() {
|
---|
| 20 | printf " %-*s %s\n" 15 "$1" "$2"
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | echo
|
---|
| 24 | if [ ! -z $1 ]; then
|
---|
| 25 | echo "Unknown command: $1"
|
---|
| 26 | fi
|
---|
| 27 | echo "Usage: $(basename $0) <command> [parameters]"
|
---|
| 28 | echo
|
---|
| 29 | echo "Commands are:"
|
---|
| 30 |
|
---|
| 31 | for C in $(listCommands); do
|
---|
| 32 | if [ "$(type -t sdtdCommand$(camelcasePrep $C)Description)" = "function" ]; then
|
---|
| 33 | line "${C}" "$(sdtdCommand$(camelcasePrep $C)Description)"
|
---|
| 34 | else
|
---|
| 35 | line "${C}" "TODO: Description"
|
---|
| 36 | fi
|
---|
| 37 | done
|
---|
| 38 |
|
---|
| 39 | echo
|
---|
| 40 | echo "Use \"$(basename $0) help <command>\" to get further details on a specific command."
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.