Skip to content

Instantly share code, notes, and snippets.

@mmrwoods
Created August 25, 2011 12:54
Show Gist options
  • Save mmrwoods/1170583 to your computer and use it in GitHub Desktop.
Save mmrwoods/1170583 to your computer and use it in GitHub Desktop.
pseudo long opts for use with getopts
# Allow pseudo long options based on naming convention.
# Long opts are converted to short opts by simply discarding all but
# the first character, which does nothing more than allow for more
# readable argument lists.
set -- `echo " $@ " | sed s/\ "-\{1,\}\([a-zA-Z]\)[-a-z]\{1,\}[=\ ]/\ -\1\ /g"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment