From 8946dd3f509a242b8ec06dbaf5522113f56671fb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 28 Sep 2012 10:38:33 -0400 Subject: Add a list-commands command --- jh-list-commands.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 jh-list-commands.sh (limited to 'jh-list-commands.sh') diff --git a/jh-list-commands.sh b/jh-list-commands.sh new file mode 100644 index 0000000..290b4e1 --- /dev/null +++ b/jh-list-commands.sh @@ -0,0 +1,13 @@ +#!/bin/bash +. /usr/bin/jh + +if [[ $# > 0 ]]; then + usage + exit 1 +fi + +for cmd_help in "$JH_PATH"/*.help.txt; do + cmd=`echo "$cmd_help"|sed -r 's|.*/jh-(.*)\.help\.txt$|\1|'` + help=`sed -n 2p "$cmd_help"` + printf "%-20s %s\n" "$cmd" "$help" +done -- cgit v1.2.2