Browse Source

Clean up main() case tables

Alois Mahdal 8 years ago
parent
commit
69360a5eae
1 changed files with 14 additions and 14 deletions
  1. 14
    14
      src/shellfu/saturnin.sh

+ 14
- 14
src/shellfu/saturnin.sh View File

@@ -161,26 +161,26 @@ saturnin__lssc() {
161 161
 saturnin__main() {
162 162
     local subcommand
163 163
     while true; do case $1 in
164
-        -d|--debug)     export PRETTY_DEBUG=true; shift   ;;
164
+        -d|--debug)     export PRETTY_DEBUG=true;   shift ;;
165 165
         -v|--verbose)   export PRETTY_VERBOSE=true; shift ;;
166
-        -h|--help)      saturnin__help; exit              ;;
167
-        --version)      saturnin__version; exit            ;;
166
+        -h|--help)      saturnin__help;             exit  ;;
167
+        --version)      saturnin__version;          exit  ;;
168 168
         --version-semver) saturnin__get app-version ;;
169
-        --saturnin-get-*) saturnin__get "$1" ;;
170
-        -*)             saturnin__usage;                ;;
171
-        --*)            saturnin__usage;                ;;
172
-        --)             shift; break                    ;;
173
-        "")             saturnin__usage;                ;;
174
-        *)              break;                          ;;
169
+        --saturnin-get-*) saturnin__get "$1"        ;;
170
+        -*)             saturnin__usage;            ;;
171
+        --*)            saturnin__usage;            ;;
172
+        --)             shift; break                ;;
173
+        "")             saturnin__usage;            ;;
174
+        *)              break;                      ;;
175 175
     esac done
176 176
     subcommand="$1"; shift
177 177
     debug -v SHELLFU_PATH SATURNIN_LIBEXEC SATURNIN_CONF_PATH
178 178
     case "$subcommand" in
179
-        conf)               saturnin__conf "$@" ;;
180
-        _ls_sc)    saturnin__lssc ;;
181
-        _lsfun)             shellfu-get lsfun ;;
182
-        _lsmod)             shellfu-get lsmod ;;
183
-        *)                  saturnin__runsc "$subcommand" "$@" ;;
179
+        conf)    saturnin__conf "$@"                ;;
180
+        _ls_sc)  saturnin__lssc                     ;;
181
+        _lsfun)  shellfu-get lsfun                  ;;
182
+        _lsmod)  shellfu-get lsmod                  ;;
183
+        *)       saturnin__runsc "$subcommand" "$@" ;;
184 184
     esac
185 185
 }
186 186