Skip to content

Instantly share code, notes, and snippets.

@deanohyeah
Created July 12, 2017 16:35
Show Gist options
  • Save deanohyeah/1e2b433a4fbb8d9519610b1db7e4f9e7 to your computer and use it in GitHub Desktop.
Save deanohyeah/1e2b433a4fbb8d9519610b1db7e4f9e7 to your computer and use it in GitHub Desktop.
Shell: example of optional flag parsing
# this function will search all passed arguments for optionalFlag's existence
function test() {
if [[ $* == *--optionalFlagt* ]]
then
do stuff
else
do other stuff
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment