#!/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"
		exit 1
		;;
	*.pdf)
		okular "$@" > /dev/null 2>&1 &
		;;
	*.html)
		firefox "$@" > /dev/null 2>&1 &
		;;
	*.mp4|*.mp3|*.wav|*.mkv)
		vlc "$@" > /dev/null 2>&1 &
		;;
	*.ods)
		libreoffice "$@" > /dev/null 2>&1 &
		;;
	*.jpg|*.png)
		feh "$@" > /dev/null 2>&1 &
		;;
	*)
		echo "No rule for opening this file has been specified"
		exit 1
		;;
esac
