aboutsummaryrefslogtreecommitdiff
path: root/src/bin/fim
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-01-04 15:41:32 -0300
committerEuAndreh <eu@euandre.org>2022-01-04 15:41:32 -0300
commit8b9a649ac05469881e17a63112cef69bdc19ed08 (patch)
tree8d75b443361d9dbb85ca2a26c54c9d32cc019034 /src/bin/fim
parent.gitignore: Remove /cron/generated/ (diff)
downloaddotfiles-8b9a649ac05469881e17a63112cef69bdc19ed08.tar.gz
dotfiles-8b9a649ac05469881e17a63112cef69bdc19ed08.tar.xz
scripts/: Move executables to src/bin/, and add a proper CLI interface to them
Diffstat (limited to 'src/bin/fim')
-rwxr-xr-xsrc/bin/fim50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/bin/fim b/src/bin/fim
new file mode 100755
index 00000000..7a21a513
--- /dev/null
+++ b/src/bin/fim
@@ -0,0 +1,50 @@
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ fim
+ fim -h
+EOF
+}
+
+help() {
+ cat <<-'EOF'
+
+ Options:
+ -h, --help show this message
+EOF
+}
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+play "$DOTFILES/sh/Positive.ogg" 2> /dev/null