diff options
author | xyz <gky44px1999@gmail.com> | 2021-09-03 01:27:04 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-09-03 01:27:04 -0700 |
commit | 9e01cf4c68e76cc1cd59c143d390be5085bc921a (patch) | |
tree | df405261336d98c905ebefbec2d932f4d6e115fa /.local | |
parent | e701d95348cd1020a9ab5ed27811cef4153a2855 (diff) |
refactor
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/curlncm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/.local/bin/curlncm b/.local/bin/curlncm index 5056b2de..7a9955f6 100755 --- a/.local/bin/curlncm +++ b/.local/bin/curlncm @@ -18,6 +18,7 @@ die () } # let a i r mutually exclusive, can improve by chain ids +# need to add usage help message after improvements # artist, song, djradio id flag=0 while getopts a:i:r: opt; do @@ -34,8 +35,8 @@ while getopts a:i:r: opt; do \?) exit 1;; esac done -shift $((OPTIND-1)) [ $flag -eq 0 ] && die "please specify at least one option" +shift $((OPTIND-1)) [ $# -gt 1 ] && die "directory name should be at the end" download_dir="${1:-"$PWD"}" [ -d "$download_dir" ] || mkdir -p "$download_dir" |