Commit 8b8ae78 1 parent be19810 commit 8b8ae78 Copy full SHA for 8b8ae78
File tree 3 files changed +22
-4
lines changed
3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ if [ `id -u` -ne 0 ]; then
61
61
# Valgrind
62
62
export VALGRIND_OPTS=" --memcheck:leak-check=full --memcheck:show-leak-kinds=all --memcheck:track-origins=yes"
63
63
64
- # # TODO: Start help50 if enabled
64
+ # Start help50 if enabled
65
65
if help50 is-enabled > /dev/null; then
66
66
help50 start
67
67
fi
Original file line number Diff line number Diff line change @@ -92,13 +92,15 @@ function _help50() {
92
92
elif [[ $status -ne 0 ]]; then # If helpless
93
93
_helpless " $typescript "
94
94
fi
95
+ else
96
+ _helped
95
97
fi
96
98
97
99
# Truncate typescript
98
100
truncate -s 0 $HELP50
99
101
}
100
102
101
- function _question () {
103
+ function _rhetorical () {
102
104
_alert " That was a rhetorical question. <3"
103
105
}
104
106
@@ -108,14 +110,17 @@ if ! type _helpful >/dev/null 2>&1; then
108
110
109
111
# Intercept accidental invocation of `yes` and `n`, which are actual programs
110
112
for name in n no y yes; do
111
- alias $name =_question
113
+ alias $name =_rhetocial
112
114
done
113
115
114
116
# Output help
115
117
local output=$( _ansi " $1 " )
116
118
_alert " $output "
117
119
}
118
120
fi
121
+ if ! type _helped > /dev/null 2>&1 ; then
122
+ function _helped() { : ; } # Silent
123
+ fi
119
124
if ! type _helpless > /dev/null 2>&1 ; then
120
125
function _helpless() { : ; } # Silent
121
126
fi
Original file line number Diff line number Diff line change @@ -56,6 +56,16 @@ function _start() {
56
56
fi
57
57
}
58
58
59
+ function _status() {
60
+ if [[ -n " $HELP50 " ]]; then
61
+ echo started
62
+ return 0
63
+ else
64
+ echo stopped
65
+ return 1
66
+ fi
67
+ }
68
+
59
69
function _stop() {
60
70
61
71
# If not helping
@@ -84,11 +94,14 @@ case "$1" in
84
94
start)
85
95
_start
86
96
;;
97
+ status)
98
+ _status
99
+ ;;
87
100
stop)
88
101
_stop
89
102
;;
90
103
* )
91
- echo " Usage: $0 [disable|enable|is-enabled|start|stop]"
104
+ echo " Usage: $0 [disable|enable|is-enabled|start|status| stop]"
92
105
exit 1
93
106
;;
94
107
esac
You can’t perform that action at this time.
0 commit comments