X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=blobdiff_plain;f=subcommand;h=d37481cdbdccb5b62268d3b788de84b61a2ab347;hp=817486dba0c43564701095b49f2069498da9ee6b;hb=refs%2Fheads%2Fpu;hpb=7975dbb183a73844f4ea2f9475a44681fda6ed0c diff --git a/subcommand b/subcommand index 817486d..d37481c 100644 --- a/subcommand +++ b/subcommand @@ -684,7 +684,21 @@ com_help() y/\n/'"$tab"'/ # and print the sucker - p' + p + ' | { + local -a cmds=() descs=() + local -i i maxlen=1 + local cmd desc + while read cmd desc; do + ((maxlen < ${#cmd})) && maxlen=${#cmd} + cmds[${#cmds[@]}]=$cmd + descs[${#descs[@]}]=$desc + done + for ((i = 0; i < ${#cmds[@]}; i++)); do + printf '%-*s %s\n' $maxlen ${cmds[$i]} \ + "${descs[$i]}" + done + } printf "\n# Try %s help for info on , or %s help -a to see\n" \ "$gsu_name" "$gsu_name" printf '# also the subcommands which are automatically generated by gsu.\n'