From 4695ff98cac2e9a2bba68e051ebfa2316ea6948f Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Tue, 23 Nov 2021 04:27:11 +0000 Subject: [PATCH] cleaning --- dotfiles-old/bin/volume | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dotfiles-old/bin/volume b/dotfiles-old/bin/volume index e7837dd..ff3c9c9 100755 --- a/dotfiles-old/bin/volume +++ b/dotfiles-old/bin/volume @@ -28,14 +28,16 @@ unknown_system(){ usage(){ printf "\ -Usage: %b [function] (argument)\n" "$argv0" +Usage: %b {function} (operand)\n" "$argv0" printf "\ Functions: + '+' - shortcut to \"relative \$2\" + '-' - shortcut to \"relative -\$2\" absolute - change sound output to absolute unit - help - print this help output + help,'' - print this help output mute - toggle mute/unmute relative - change sound output relative to current status - status - print current sound output in system unit + status - print current sound output in system unit \ " printf "\ The options are matched with [char]*. So \"%b help\" @@ -45,9 +47,10 @@ works the same as \"%b h\". exit 1 } +# $1 becomes 'help' if previously empty [ -n "$1" ] \ && argv1="$1" \ - || argv1=s + || argv1=help case "$argv1" in # @@ -99,7 +102,6 @@ case "$argv1" in && "$argv0" r -"$2" \ || usage ;; -(h*) usage ;; (m*) [ -z "$2" ] || usage # restore previous volume if there is one @@ -139,5 +141,6 @@ case "$argv1" in fi "$argv0" a $newval exit $? ;; -(*) usage +(h*) usage ;; +(*) usage ;; esac