Skip to content

Instantly share code, notes, and snippets.

@nmccready
Created April 23, 2019 20:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmccready/e766ab5ba53c2b34e51fa03d89a7ff22 to your computer and use it in GitHub Desktop.
Save nmccready/e766ab5ba53c2b34e51fa03d89a7ff22 to your computer and use it in GitHub Desktop.
argument collector
#!/bin/sh
set -e
set -o pipefail
# collect arguments to forward on
while [[ "$#" > 0 ]]; do case $1 in
# example to save value
# -v|--data-volume) shift; dataVolume=$1;; # --data-volume someval
*) args[${#args[@]}]=$1;;
esac; shift; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment