Permalink
Browse files

Tell getopt to parse POSIX compatible.

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...
1 parent 47d1b9d commit e1ec57d48ac5c234262d84469af56b00b38929ab @nvie committed Oct 18, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 git-flow
View
5 git-flow
@@ -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"

0 comments on commit e1ec57d

Please sign in to comment.