Skip to content

Commit

Permalink
Tell getopt to parse POSIX compatible.
Browse files Browse the repository at this point in the history
By setting the environmental variable POSIXLY_CORRECT, getopt behaves
strictly POSIX-compatible.  This fixes the incorrect getopt parsing
style that breaks git-flow in several flavours of Linux.

Many thanks to Thiana for figuring this one out.

This should fix issues #28 and #29.
  • Loading branch information
nvie committed Oct 18, 2010
1 parent 47d1b9d commit e1ec57d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions git-flow
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ main() {
# load common functionality
. "$GITFLOW_DIR/gitflow-common"

# This environmental variable fixes non-POSIX getopt style argument
# parsing, effectively breaking git-flow subcommand parsing on several
# Linux platforms.
export POSIXLY_CORRECT=1

# use the shFlags project to parse the command line arguments
. "$GITFLOW_DIR/gitflow-shFlags"
FLAGS_PARENT="git flow"
Expand Down

0 comments on commit e1ec57d

Please sign in to comment.