Created
August 1, 2018 02:25
-
-
Save schuchard/51cafd491aa47a136a82f48d933e9175 to your computer and use it in GitHub Desktop.
CLI for bash scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# run `sh run.sh` for options | |
# run `sh run.sh hello` | |
volt() { | |
printf "\xE2\x9A\xA1"; | |
} | |
run_hello() { | |
echo "\n<<< hello world >>>\n"; | |
} | |
print_usage() { | |
echo " | |
COMMANDS:\n | |
$(volt) hello | hello world" | |
} | |
case "$1" in | |
hello) run_hello ;; | |
*) print_usage ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment