Browse Source

Use proper naming scheme

Alois Mahdal 9 years ago
parent
commit
ed7847f49b
2 changed files with 12 additions and 12 deletions
  1. 3
    3
      src/bin/satcmd.skel
  2. 9
    9
      src/shellfu/saturnin.sh

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

65
 
65
 
66
 case "$SATURNIN_SUBCOMMAND" in
66
 case "$SATURNIN_SUBCOMMAND" in
67
     conf)               inigrep "$@"    ;;
67
     conf)               inigrep "$@"    ;;
68
-    help)               saturnin_help ;;
69
-    _ls_subcommands)    saturnin_lssc ;;
68
+    help)               saturnin__help ;;
69
+    _ls_subcommands)    saturnin__lssc ;;
70
     _lsfun)             shellfu-get lsfun ;;
70
     _lsfun)             shellfu-get lsfun ;;
71
     _lsmod)             shellfu-get lsmod ;;
71
     _lsmod)             shellfu-get lsmod ;;
72
     _ffrun)             ffrun "$@" ;;
72
     _ffrun)             ffrun "$@" ;;
73
-    *)                  saturnin_runsc "$@" ;;
73
+    *)                  saturnin__runsc "$@" ;;
74
 esac
74
 esac

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

4
 shellfu import inigrep
4
 shellfu import inigrep
5
 shellfu import pretty
5
 shellfu import pretty
6
 
6
 
7
-saturnin_help() {
7
+saturnin__help() {
8
     {
8
     {
9
         echo "built-in commands:"
9
         echo "built-in commands:"
10
         echo "    conf"
10
         echo "    conf"
11
         echo "    help"
11
         echo "    help"
12
         echo ""
12
         echo ""
13
         echo "installed commands:"
13
         echo "installed commands:"
14
-        saturnin_lssc \
14
+        saturnin__lssc \
15
           | sed -e 's/^/    /'
15
           | sed -e 's/^/    /'
16
     } | mkhelp -E -f -
16
     } | mkhelp -E -f -
17
     return "$SHELLFU_EXIT_OK"
17
     return "$SHELLFU_EXIT_OK"
18
 }
18
 }
19
 
19
 
20
-saturnin_lssc() {
20
+saturnin__lssc() {
21
     find "$SATURNIN_LIBEXEC" \
21
     find "$SATURNIN_LIBEXEC" \
22
         -mindepth 1 \
22
         -mindepth 1 \
23
         -maxdepth 1 \
23
         -maxdepth 1 \
26
       | sort
26
       | sort
27
 }
27
 }
28
 
28
 
29
-saturnin_runhook() {
29
+saturnin__runhook() {
30
     #
30
     #
31
     # Run custom hook
31
     # Run custom hook
32
     #
32
     #
45
     eval "$hook_code"
45
     eval "$hook_code"
46
 }
46
 }
47
 
47
 
48
-saturnin_runsc() {
48
+saturnin__runsc() {
49
     local lexpath
49
     local lexpath
50
     lexpath+="$SATURNIN_LIBEXEC/"
50
     lexpath+="$SATURNIN_LIBEXEC/"
51
     lexpath+="$SATURNIN_LIBEXEC_PREFIX$SATURNIN_SUBCOMMAND"
51
     lexpath+="$SATURNIN_LIBEXEC_PREFIX$SATURNIN_SUBCOMMAND"
53
     debug "\$*='$*'"
53
     debug "\$*='$*'"
54
     test -x "$lexpath" || {
54
     test -x "$lexpath" || {
55
         warn "invalid sub-command: $SATURNIN_SUBCOMMAND"
55
         warn "invalid sub-command: $SATURNIN_SUBCOMMAND"
56
-        saturnin_help
56
+        saturnin__help
57
         return "$SHELLFU_EXIT_USAGE"
57
         return "$SHELLFU_EXIT_USAGE"
58
     }
58
     }
59
     "$lexpath" "$@"
59
     "$lexpath" "$@"
60
 }
60
 }
61
 
61
 
62
-saturnin_wraphook() {
62
+saturnin__wraphook() {
63
     #
63
     #
64
     # Wrap command "$@" in hooks
64
     # Wrap command "$@" in hooks
65
     #
65
     #
68
     # post-hook if "$@" failed.
68
     # post-hook if "$@" failed.
69
     #
69
     #
70
     local es=0
70
     local es=0
71
-    saturnin_runhook pre
71
+    saturnin__runhook pre
72
     "$@" || return $?
72
     "$@" || return $?
73
     es=$?
73
     es=$?
74
-    saturnin_runhook post
74
+    saturnin__runhook post
75
     return $es
75
     return $es
76
 }
76
 }