Browse Source

Move usage() to saturnin.sh module

Alois Mahdal 8 years ago
parent
commit
594e675521
2 changed files with 9 additions and 9 deletions
  1. 3
    9
      src/bin/satcmd.skel
  2. 6
    0
      src/shellfu/saturnin.sh

+ 3
- 9
src/bin/satcmd.skel View File

@@ -36,12 +36,6 @@ shellfu import saturnin
36 36
 export SHELLFU_INIGREP_PATH SHELLFU_PATH SHELLFU_PRETTY_USAGE \
37 37
        SATURNIN_CACHE_HOME
38 38
 
39
-usage() {
40
-    mkusage "[-d|-v] command [args...]" \
41
-            "help" \
42
-            "--version"
43
-}
44
-
45 39
 main() {
46 40
     local subcommand
47 41
     while true; do case $1 in
@@ -49,10 +43,10 @@ main() {
49 43
         -v|--verbose)   export SHELLFU_VERBOSE=true; shift ;;
50 44
         --version)      saturnin__version; exit            ;;
51 45
         --version-semver) echo "$SATURNIN_APP_VERSION"; exit ;;
52
-        -*)             usage;                          ;;
53
-        --*)            usage;                          ;;
46
+        -*)             saturnin__usage;                ;;
47
+        --*)            saturnin__usage;                ;;
54 48
         --)             shift; break                    ;;
55
-        "")             usage;                          ;;
49
+        "")             saturnin__usage;                ;;
56 50
         *)              break;                          ;;
57 51
     esac done
58 52
     subcommand="$1"; shift

+ 6
- 0
src/shellfu/saturnin.sh View File

@@ -68,6 +68,12 @@ saturnin__runsc() {
68 68
     "$binpath" "$@"
69 69
 }
70 70
 
71
+saturnin__usage() {
72
+    mkusage "[-d|-v] command [args...]" \
73
+            "help" \
74
+            "--version"
75
+}
76
+
71 77
 saturnin__version() {
72 78
     #
73 79
     # Print version info