diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-09-28 10:38:59 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-09-28 10:38:59 -0400 |
commit | c6ce7d6ba0272ab78b2dd09e3fadc49b577961c0 (patch) | |
tree | 75a6d404e620f405c456dc669b0f6a9b8d352238 | |
parent | 8946dd3f509a242b8ec06dbaf5522113f56671fb (diff) |
Change how the main help menu works
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | jh-.help.txt | 0 | ||||
-rw-r--r-- | jh.sh | 7 |
3 files changed, 9 insertions, 4 deletions
@@ -4,14 +4,14 @@ dirs = $(DESTDIR)/usr/share/jh $(DESTDIR)/usr/bin #### subcommand_files = $(addprefix jh-,$(subcommands)) -help_files = $(addsuffix .help.txt,jh- $(subcommand_files)) +help_files = $(addsuffix .help.txt,$(subcommand_files)) all: PHONY build #### -build: PHONY jh $(subcommand_files) $(help_files) -install: $(DESTDIR)/usr/bin/jh $(addprefix $(DESTDIR)/usr/share/jh/,$(subcommand_files) $(help_files)) +build: PHONY jh $(subcommand_files) +install: PHONY $(DESTDIR)/usr/bin/jh $(addprefix $(DESTDIR)/usr/share/jh/,$(subcommand_files) $(help_files)) $(DESTDIR)/usr/share/jh/%: % | $(DESTDIR)/usr/share/jh cp '$<' '$@' diff --git a/jh-.help.txt b/jh-.help.txt deleted file mode 100644 index e69de29..0000000 --- a/jh-.help.txt +++ /dev/null @@ -12,7 +12,12 @@ fi usage() { cmd="${1-$0}" file="$JH_PATH/jh-$cmd.help.txt" - if [[ -f "$JH_PATH/jh-$cmd.help.txt" ]]; then + if [[ -z "$cmd" ]]; then + echo "Usage: $jh_short <command> [command-specific-arguments]" + echo "Java helper for PKGBUILDs" + echo "" + "$jh_short" list-commands|sed 's/./ &/' + elif [[ -f "$JH_PATH/jh-$cmd.help.txt" ]]; then sed "s|@cmd@|$jh_short|g" "$file" >> /dev/stderr else echo "$jh_short: Cannot find help file for '$cmd'" >> /dev/stderr |