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