| Rev | Line | |
|---|
| [17] | 1 | #!/bin/bash
|
|---|
| 2 | # Version 4
|
|---|
| 3 |
|
|---|
| 4 | genericHelp() {
|
|---|
| 5 | line() {
|
|---|
| 6 | printf " %-*s %s\n" 15 "$1" "$2"
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | echo
|
|---|
| 10 | if [ ! -z $1 ]; then
|
|---|
| 11 | echo "Unknown command: $1"
|
|---|
| 12 | fi
|
|---|
| 13 | echo "Usage: $(basename $0) <command> [parameters]"
|
|---|
| 14 | echo
|
|---|
| 15 | echo "Commands are:"
|
|---|
| 16 |
|
|---|
| 17 | for C in $(listCommands); do
|
|---|
| 18 | if [ "$(type -t sdtdCommand$(camelcasePrep $C)Description)" = "function" ]; then
|
|---|
| 19 | line "${C}" "$(sdtdCommand$(camelcasePrep $C)Description)"
|
|---|
| 20 | else
|
|---|
| 21 | line "${C}" "TODO: Description"
|
|---|
| 22 | fi
|
|---|
| 23 | done
|
|---|
| 24 |
|
|---|
| 25 | echo
|
|---|
| 26 | echo "Use \"$(basename $0) help <command>\" to get further details on a specific command."
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.