summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpbs-help28
1 files changed, 27 insertions, 1 deletions
diff --git a/pbs-help b/pbs-help
index b60fad9..35157b8 100755
--- a/pbs-help
+++ b/pbs-help
@@ -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() {