diff --git a/pulseaudio-tcp b/pulseaudio-tcp index 6be38e4..3566d5d 100644 --- a/pulseaudio-tcp +++ b/pulseaudio-tcp @@ -24,8 +24,10 @@ usage() { cat >&2 < ~/.config/pulse/cookie + elif _scp "$remote_user"@"$remote_ip":.config/pulse/cookie ~/.config/pulse/cookie ; then debug "Synced PulseAudio cookie from remote host $remote_ip." return 0 else @@ -457,9 +465,15 @@ do_stop() { # Arguments operation= +cookie= no_more_options=false +# shellcheck disable=SC2034 + +while [[ $# -gt 0 ]] ; do + arg=$1 + shift + echo "DEBUG: parsing arg=$arg .." >&2 -for arg in "$@" ; do case "$arg" in --) no_more_options=true @@ -467,6 +481,11 @@ for arg in "$@" ; do --*) "$no_more_options" && { gui=false error "Option arguments may not preceed non-option arguments." ; exit 1 ; } ;;& + --cookie) + [[ $# -eq 0 ]] && { gui=false error "Missing argument for option \"--cookie\"" ; exit 1 ; } + cookie=$1 + shift + ;; --debug) debug_cmdline=true ;;