diff options
-rwxr-xr-x | pbs-help | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -4,9 +4,35 @@ stem=pbs +presort() { + local r + while read -r cmd; do + r=6 + case "$cmd" in + help) r=0;; + init) r=1;; + + download|upload) r=2;; + + package-fork|package-new) r=3;; + package-*commit) r=5;; + package-*) r=4;; + + convert-*) r=8;; + plumb-*) r=9;; + esac + printf '%d;%s\n' "$r" "$cmd" + done +} + +postsort() { + cut -d';' -f2 +} + list_commands() { find ${PATH//:/ } -type f -executable -name "$stem-*" \ - -printf '%f\n' 2>/dev/null | sed "s/^${stem}-//;/--/d" | sort + -printf '%f\n' 2>/dev/null | sed "s/^${stem}-//;/--/d" | + presort | sort | postsort } master_usage() { |