Browse Source

Add meta-command

Alois Mahdal 10 years ago
parent
commit
db68ebc954
2 changed files with 53 additions and 0 deletions
  1. 52
    0
      bin/saturnin.skel
  2. 1
    0
      setup/mk.sh

+ 52
- 0
bin/saturnin.skel View File

@@ -0,0 +1,52 @@
1
+#!/bin/bash
2
+
3
+. <(ffoom init)
4
+FFOO_INI_PATH="__SATURNIN_INI_PATH__:$SATURNIN_INI_PATH"
5
+
6
+ffoo import exit
7
+ffoo import core
8
+
9
+usage() {
10
+    usage_is "[-d|-v] command [args...]" \
11
+             "help"
12
+}
13
+
14
+print_help() {
15
+    echo "valid commands:"
16
+    echo ""
17
+    echo "   abrt"
18
+    echo "   czrates"
19
+    echo "   dmenu"
20
+    echo "   get"
21
+    echo "   iam"
22
+    echo "   ini"
23
+    echo "   ip"
24
+    echo "   ln"
25
+    echo "   peg"
26
+    echo "   push"
27
+    echo "   revert"
28
+    echo "   watch"
29
+    echo "   www"
30
+}
31
+
32
+while true; do case $1 in
33
+    -d|--debug)     FFOO_DEBUG=true; shift      ;;
34
+    -v|--verbose)   FFOO_VERBOSE=true; shift    ;;
35
+    --)             shift; break                ;;
36
+    "")             usage;                      ;;
37
+    *)              break;                      ;;
38
+esac done
39
+
40
+debug "\$@=$@"
41
+
42
+scmd=$1
43
+shift
44
+
45
+case $scmd in
46
+    abrt|czrates|dmenu|get|iam|ini|ip|ln|peg|push|revert|watch|www)
47
+        debug -v scmd
48
+        debug "\$@=$@"
49
+        exec saturnin-$scmd "$@" ;;
50
+    help)  print_help; exit $FFOO_EXIT_OK ;;
51
+    *)  print_help; exit $FFOO_EXIT_USAGE ;;
52
+esac

+ 1
- 0
setup/mk.sh View File

@@ -10,6 +10,7 @@ rm -f $tmp
10 10
 bindir=${DESTDIR}${PREFIX}/bin
11 11
 
12 12
 list_of_bins() {
13
+    echo bin/saturnin
13 14
     echo bin/saturnin-abrt
14 15
     echo bin/saturnin-czrates
15 16
     echo bin/saturnin-dmenu