summaryrefslogtreecommitdiff
path: root/custom/uucp-mediaserver
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-09-25 19:21:19 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-09-25 19:21:19 +0200
commit53bf3a2c099192d483bf4108772297b6fc215140 (patch)
tree5195233d600ed46f161e003611fb6208d944471a /custom/uucp-mediaserver
parent07f00aaa7f19c346060f383f500fb0ad3319d58a (diff)
downloadnixos-53bf3a2c099192d483bf4108772297b6fc215140.tar
nixos-53bf3a2c099192d483bf4108772297b6fc215140.tar.gz
nixos-53bf3a2c099192d483bf4108772297b6fc215140.tar.bz2
nixos-53bf3a2c099192d483bf4108772297b6fc215140.tar.xz
nixos-53bf3a2c099192d483bf4108772297b6fc215140.zip
better options
Diffstat (limited to 'custom/uucp-mediaserver')
-rwxr-xr-xcustom/uucp-mediaserver/scripts/queue30
1 files changed, 7 insertions, 23 deletions
diff --git a/custom/uucp-mediaserver/scripts/queue b/custom/uucp-mediaserver/scripts/queue
index 1644bd2d..49c7a3bc 100755
--- a/custom/uucp-mediaserver/scripts/queue
+++ b/custom/uucp-mediaserver/scripts/queue
@@ -46,29 +46,13 @@ suffix=${base##*.}
46force=0 46force=0
47noCall=false 47noCall=false
48prepend=false 48prepend=false
49while getopts "frp" OPT; do 49
50 case $OPT in 50typeset -A opts
51 r) 51zparseopts -A opts -- r p f::
52 noCall=true 52
53 ;; 53force=${opts[-f]:-${+opts[-f]}}
54 f) 54[[ -v opts[-p] ]] && prepend=true
55 if [[ ${@:$OPTIND} =~ ^[0-9]+$ ]];then 55[[ -v opts[-r] ]] && noCall=true
56 force=${@:$OPTIND}
57 OPTIND=$((OPTIND+1))
58 else
59 force=1
60 fi
61 ;;
62 p)
63 prepend=true
64 ;;
65 \?)
66 echo "Invalid option -${OPTARG}" >&2
67 exit 2
68 ;;
69 esac
70done
71shift $((OPTIND-1))
72 56
73printf "force: %d, noCall: %s, prepend: %s\n" ${force} ${noCall} ${prepend} | debug 57printf "force: %d, noCall: %s, prepend: %s\n" ${force} ${noCall} ${prepend} | debug
74 58