37 lines
463 B
Bash
Executable file
37 lines
463 B
Bash
Executable file
#!/bin/sh
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
nope
|
|
opens files
|
|
|
|
Usage: nope FILE
|
|
|
|
Flags:
|
|
--help, -h Displays this help
|
|
--version, -v Show version and exit
|
|
EOF
|
|
}
|
|
|
|
case "$@" in
|
|
--help)
|
|
usage
|
|
exit 1
|
|
;;
|
|
--version)
|
|
echo "nope version 0.1.0"
|
|
;;
|
|
*.pdf)
|
|
okular "$@" > /dev/null 2>&1 &
|
|
;;
|
|
*.html)
|
|
firefox "$@" > /dev/null 2>&1 &
|
|
;;
|
|
*.mp4|*.mp3)
|
|
vlc "$@" > /dev/null 2>&1 &
|
|
;;
|
|
*)
|
|
echo "No rule for opening this file has been specified"
|
|
exit 1
|
|
;;
|
|
esac
|