Created
February 23, 2021 05:59
-
-
Save wakusei-meron-/551d68e40f7a12a850b8bc7f190de2df to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
SCRIPT_DIR=$(cd $(dirname $0); pwd) | |
# -e: エラーがあれば途中終了 | |
# -u: 未定義変数の場合はエラー | |
# -x: 実行コマンドの出力 | |
set -eux | |
function usage { | |
cat <<EOF | |
$(basename ${0}) is a tool for ... | |
Usage: | |
$(basename ${0}) [command] [<options>] | |
Options: | |
--version, -v print $(basename ${0}) version | |
--help, -h print this | |
EOF | |
} | |
function print() { | |
: $1: param | |
param=$1 | |
echo $param | |
} | |
case $1 in | |
print) | |
print $2 | |
;; | |
*) | |
usage | |
;; | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment