Skip to content

Instantly share code, notes, and snippets.

@wakusei-meron-
Created February 23, 2021 05:59
Show Gist options
  • Save wakusei-meron-/551d68e40f7a12a850b8bc7f190de2df to your computer and use it in GitHub Desktop.
Save wakusei-meron-/551d68e40f7a12a850b8bc7f190de2df to your computer and use it in GitHub Desktop.
#!/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