Change command line argument parsing
This commit is contained in:
parent
d100183b5c
commit
0ce80a8767
2 changed files with 5 additions and 5 deletions
8
nope
8
nope
|
|
@ -5,19 +5,19 @@ usage() {
|
|||
echo opens files
|
||||
}
|
||||
|
||||
case $1 in
|
||||
case $@ in
|
||||
--help)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
*.pdf)
|
||||
okular $1 > /dev/null 2>&1 &
|
||||
okular $@ > /dev/null 2>&1 &
|
||||
;;
|
||||
*.html)
|
||||
firefox $1 > /dev/null 2>&1 &
|
||||
firefox $@ > /dev/null 2>&1 &
|
||||
;;
|
||||
*.mp4|*.mp3)
|
||||
vlc $1 > /dev/null 2>&1 &
|
||||
vlc $@ > /dev/null 2>&1 &
|
||||
;;
|
||||
*)
|
||||
echo "No rule for opening this file has been specified"
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ if ! (which ffmpeg) ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
youtube-dl --format bestaudio -x --audio-format mp3 --audio-quality 320K -k $1
|
||||
youtube-dl --format bestaudio -x --audio-format mp3 --audio-quality 320K -k $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue