Skip to content

Commit

Permalink
change shortcut script option parsin (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdietz authored and lukesneeringer committed Dec 19, 2018
1 parent 7502b50 commit 9ec885d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gapic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PROTO_PATH=`pwd`

# Print help and exit.
function show_help {
echo "Usage: $CMD --image IMAGE --in IN_DIR --out OUT_DIR [--options PLUGIN_OPTIONS --path PATH_DIR]"
echo "Usage: $CMD --image IMAGE --in IN_DIR --out OUT_DIR [--path PATH_DIR]"
echo ""
echo "Required arguments:"
echo " --image The Docker image to use. The script will attempt to pull"
Expand All @@ -35,7 +35,6 @@ function show_help {
echo " -o, --out Destination directory for the completed client library."
echo ""
echo "Optional arguments:"
echo " --options Options to be passed to the generator plugin"
echo " -p, --path The base import path for the protos. Assumed to be the"
echo " current working directory if unspecified."
echo " -h, --help This help information."
Expand All @@ -49,8 +48,8 @@ while true; do
--image ) IMAGE="$2"; shift 2 ;;
-i | --in ) IN="$2"; shift 2 ;;
-o | --out ) OUT="$2"; shift 2 ;;
--options ) PLUGIN_OPTIONS="$2"; shift 2 ;;
-p | --path ) PROTO_PATH=$2; shift 2 ;;
--* ) PLUGIN_OPTIONS="$PLUGIN_OPTIONS $1 $2"; shift 2 ;;
-- ) shift; break; ;;
* ) break ;;
esac
Expand Down Expand Up @@ -92,6 +91,6 @@ docker run \
--mount type=bind,source=$OUT,destination=/out \
--rm \
--user $UID \
--env "PLUGIN_OPTIONS=$PLUGIN_OPTIONS" \
$IMAGE
$IMAGE \
$PLUGIN_OPTIONS
exit $?

0 comments on commit 9ec885d

Please sign in to comment.