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.
diff --git a/git-flow b/git-flow
index e95d4ad..fa87e71 100755
--- a/git-flow
+++ b/git-flow
@@ -67,6 +67,11 @@
# 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"