Skip to content

Commit

Permalink
Update script usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Lubken committed Sep 23, 2024
1 parent 37e1973 commit 80359a5
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions scripts/push.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
#!/usr/bin/env bash
set -euo pipefail

usage() {
cat << EOF
Usage: $0 [options]
Options:
-p, --password string GitHub password
-r, --repository string GitHub organization/project
-u, --username string GitHub username
-b, --branch string Github branch
(default: main)
-c, --canary Github canary project
(default: <project>canary)
-h, --host GitHub branch
(default: github.com)
EOF
}

while [ $# -gt 0 ]; do
case "$1" in
case "$1" in
-b|--branch)
branch="$2"
;;
shift 2
;;
-c|--canary)
canary="$2"
;;
shift 2
;;
-h|--host)
host="$2"
shift 2
;;
-r|--repository)
repository="$2"
;;
shift 2
;;
-p|--password)
password="$2"
;;
shift 2
;;
-u|--username)
username="$2"
;;
shift 2
;;
*)
echo "Invalid argument: $1"
echo "Required:"
echo " --password"
echo " --repository organization/project"
echo " --username"
echo "Optional:"
echo " --branch main"
echo " --canary projectcanary"
echo " --host github.com"
echo "Error: Invalid argument $1" >&2
usage
exit 1
esac
shift
shift
done

branch=${branch:-"main"}
Expand Down

0 comments on commit 80359a5

Please sign in to comment.