Browse Source

Add internal subcommand _ls_subcommands

Alois Mahdal 9 years ago
parent
commit
6af447c64f
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      src/bin/saturnin.skel

+ 10
- 5
src/bin/saturnin.skel View File

64
     echo ""
64
     echo ""
65
     echo "installed sub-commands:"
65
     echo "installed sub-commands:"
66
     echo ""
66
     echo ""
67
+    ls_subcommands | sed -e 's/^/    /'
68
+    return "$FFOO_EXIT_OK"
69
+}
70
+
71
+ls_subcommands() {
67
     find "$SATURNIN_LIBEXEC" \
72
     find "$SATURNIN_LIBEXEC" \
68
         -mindepth 1 \
73
         -mindepth 1 \
69
         -maxdepth 1 \
74
         -maxdepth 1 \
70
         -executable \
75
         -executable \
71
-      | sed -e 's/.*saturnin-/    /' \
76
+      | sed -e 's/.*saturnin-//' \
72
       | sort
77
       | sort
73
-    return "$FFOO_EXIT_OK"
74
 }
78
 }
75
 
79
 
76
 version_info() {
80
 version_info() {
120
 shift
124
 shift
121
 
125
 
122
 case "$SATURNIN_SUBCOMMAND" in
126
 case "$SATURNIN_SUBCOMMAND" in
123
-    conf)   inigrep "$@"    ;;
124
-    help)   print_help      ;;
125
-    *)      subcommand "$@" ;;
127
+    conf)               inigrep "$@"    ;;
128
+    help)               print_help      ;;
129
+    _ls_subcommands)    ls_subcommands ;;
130
+    *)                  subcommand "$@" ;;
126
 esac
131
 esac