Skip to content

Commit

Permalink
added on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan committed Jan 6, 2024
1 parent cadd890 commit 3041bf9
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions etc/profile.d/help50.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ help50() {
}

_help50() {
if [[ -f "$HELPFUL" ]]; then
_helpful "$HELPFUL"
elif [[ -f "$HELPLESS" ]]; then
_helpless "$HELPLESS"
if [[ "$RUBBERDUCKING" != "0" ]]; then
if [[ -f "$HELPFUL" ]]; then
_helpful "$HELPFUL"
elif [[ -f "$HELPLESS" ]]; then
_helpless "$HELPLESS"
fi
fi
rm --force "$HELPFUL" "$HELPLESS"
}
Expand All @@ -77,4 +79,19 @@ _helpful() {

_helpless() { :; }

duck() {
if [[ "$1" == "off" ]]; then
export RUBBERDUCKING=0
elif [[ "$1" == "on" ]]; then
unset RUBBERDUCKING
elif [[ "$1" == "status" ]]; then
if [[ "$RUBBERDUCKING" == "0" ]]; then
echo "off"
else
echo "on"
fi
fi
}

export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_help50"
duck on

0 comments on commit 3041bf9

Please sign in to comment.