source: scripts/usr/local/lib/7dtd/help.sh@ 20

Last change on this file since 20 was 20, checked in by alloc, 10 years ago

Version 5. Fixes #9, #11

File size: 568 bytes
RevLine 
[17]1#!/bin/bash
[20]2# Version 5
[17]3
4genericHelp() {
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.