Browse Source

Do not repeat verbose/debug mode handling

Scripts are supposed to be launched as sub-commands of /bin/saturnin, which
can easily handle this for them.

Or you can still set these variables by hand.  (i.e. `FFOO_DEBUG=true saturnin-www`)
Alois Mahdal 10 years ago
parent
commit
608bd7d203
5 changed files with 4 additions and 35 deletions
  1. 0
    7
      bin/saturnin-ini.skel
  2. 1
    6
      bin/saturnin-ln
  3. 0
    3
      bin/saturnin-push
  4. 3
    13
      bin/saturnin-revert
  5. 0
    6
      bin/saturnin-watch

+ 0
- 7
bin/saturnin-ini.skel View File

@@ -5,13 +5,6 @@ FFOO_INI_PATH="__SATURNIN_INI_PATH__:$SATURNIN_INI_PATH"
5 5
 
6 6
 ffoo import ini
7 7
 
8
-while true; do case $1 in
9
-    -d|--debug)     FFOO_DEBUG=true; shift      ;;
10
-    -v|--verbose)   FFOO_VERBOSE=true; shift    ;;
11
-    --)             shift; break                ;;
12
-    *)              break;                      ;;
13
-esac done
14
-
15 8
 debug "\$*=$*"
16 9
 
17 10
 iniread "$@"

+ 1
- 6
bin/saturnin-ln View File

@@ -21,10 +21,7 @@ else:
21 21
 "
22 22
 
23 23
 usage() {
24
-    local u
25
-    u="[-d|--debug] [-f|--force] [-v|--verbose]"
26
-    u="$u [-t|--target TARGET] SOURCE [NAME]"
27
-    usage_is "$u"
24
+    usage_is "[-f|--force] [-t|--target TARGET] SOURCE [NAME]"
28 25
 }
29 26
 
30 27
 link() {
@@ -45,9 +42,7 @@ load() {
45 42
 }
46 43
 
47 44
 while true; do case $1 in
48
-    -d|--debug)         FFOO_DEBUG=true;    shift   ;;
49 45
     -f|--force)         FORCE=true;         shift   ;;
50
-    -v|--verbose)       FFOO_VERBOSE=true;  shift   ;;
51 46
     -t|--target)        target=$2           shift 2 ;;
52 47
     "")                 usage                       ;;
53 48
     *)                  src=$1; name=$2;    break   ;;

+ 0
- 3
bin/saturnin-push View File

@@ -8,9 +8,6 @@ ffoo import recon
8 8
 ORDER="$(saturnin-ini -p push.options.order)"
9 9
 
10 10
 while true; do case $1 in
11
-    -d|--debug)     FFOO_DEBUG=true;    shift;      ;;
12
-    -v|--verbose)   FFOO_VERBOSE=true;  shift;      ;;
13
-    -q|--quiet)     FFOO_VERBOSE=false; shift;      ;;
14 11
     -o|--order)     ORDER=$2;           shift 2;    ;;
15 12
     -h|--help)      usage;                          ;;
16 13
     "")             break                           ;;

+ 3
- 13
bin/saturnin-revert View File

@@ -5,8 +5,10 @@
5 5
 ffoo import core
6 6
 ffoo import recon
7 7
 
8
+FFOO_VERBOSE=${FFOO_VERBOSE:-true}
9
+
8 10
 usage() {
9
-    usage_is "[-d|--debug] [-v|--verbose] [--dry-run] [-c|--connection] domain [snapshot]"
11
+    usage_is "[--dry-run] [-c|--connection] domain [snapshot]"
10 12
 }
11 13
 
12 14
 FFOO_DRY_RUN=false
@@ -18,18 +20,6 @@ while true; do
18 20
             connection=$2
19 21
             shift 2
20 22
             ;;
21
-        -d|--debug)
22
-            FFOO_DEBUG=true
23
-            shift 1
24
-            ;;
25
-        -q|--quiet)
26
-            FFOO_VERBOSE=false
27
-            shift 1
28
-            ;;
29
-        -v|--verbose)
30
-            FFOO_VERBOSE=true
31
-            shift 1
32
-            ;;
33 23
         --dry-run)
34 24
             FFOO_DRY_RUN=true
35 25
             shift 1

+ 0
- 6
bin/saturnin-watch View File

@@ -5,8 +5,6 @@
5 5
 ffoo import core
6 6
 ffoo import recon
7 7
 
8
-FFOO_DEBUG=false
9
-
10 8
 interval=2
11 9
 
12 10
 report_limits() {
@@ -43,10 +41,6 @@ do
43 41
             interval=$2
44 42
             shift 2
45 43
             ;;
46
-        -d|--debug)
47
-            FFOO_DEBUG=true
48
-            shift 1
49
-            ;;
50 44
         -r|--regexes)
51 45
             regexes=$2
52 46
             shift 2