Browse Source

Enable --help (friendly usage()) in saturnin__conf()

Alois Mahdal 8 years ago
parent
commit
5a16d0c943
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/shellfu/saturnin.sh

+ 3
- 1
src/shellfu/saturnin.sh View File

96
         -P:*)   ig_mode=$1; ig_query=""; shift 1; break ;;
96
         -P:*)   ig_mode=$1; ig_query=""; shift 1; break ;;
97
         .*:*)   warn "bad syntax: $*"; _saturnin__conf_usage ;;
97
         .*:*)   warn "bad syntax: $*"; _saturnin__conf_usage ;;
98
         *.*:*)  ig_mode=-e; ig_query=$1; shift 1; break ;;
98
         *.*:*)  ig_mode=-e; ig_query=$1; shift 1; break ;;
99
+        --help:*) _saturnin__conf_usage -e 0                 ;;
99
         *)      warn "bad syntax: $*"; _saturnin__conf_usage ;;
100
         *)      warn "bad syntax: $*"; _saturnin__conf_usage ;;
100
     esac done
101
     esac done
101
     test -n "$ig_mode" || { warn "could not determine inigrep mode"; _saturnin__conf_usage; }
102
     test -n "$ig_mode" || { warn "could not determine inigrep mode"; _saturnin__conf_usage; }
362
     # Show usage message and exit
363
     # Show usage message and exit
363
     #
364
     #
364
     PRETTY_USAGE="self=${0##*/} conf" \
365
     PRETTY_USAGE="self=${0##*/} conf" \
365
-    mkusage "[options] [-e] SECTION.KEY [FNAME]"                               \
366
+    mkusage "$@"                                                               \
367
+            "[options] [-e] SECTION.KEY [FNAME]"                               \
366
             "[options] -r SECTION.KEY [FNAME]"                                 \
368
             "[options] -r SECTION.KEY [FNAME]"                                 \
367
             "[options] -K SECTION [FNAME]"                                     \
369
             "[options] -K SECTION [FNAME]"                                     \
368
             "[options] -P FNAME"                                               \
370
             "[options] -P FNAME"                                               \