mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Replace case with a function call
This commit is contained in:
parent
3222354d50
commit
32c88a2f13
@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
COMMAND="${1:-help}"
|
||||
NUM="${2:-5}"
|
||||
|
||||
# Uncomment the following line to use Pulseaudio.
|
||||
@ -19,10 +20,12 @@ else
|
||||
control() { alsamixer ;}
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
toggle) toggle ;;
|
||||
mute) mute ;;
|
||||
up) up ;;
|
||||
down) down ;;
|
||||
control) control ;;
|
||||
esac
|
||||
help() {
|
||||
echo "usage: lmc <command> [<num>]"
|
||||
echo "commands:"
|
||||
sed -n 's/^\s*\(\S*\)().*/- \1/p' "$0" | sort -u
|
||||
}
|
||||
|
||||
type "$COMMAND" | grep function >/dev/null && "$COMMAND" \
|
||||
|| echo "lmc: command not defined: $COMMAND" >&2
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user