Skip to content

Commit e1ec57d

Browse files
committed
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 nvie#28 and nvie#29.
1 parent 47d1b9d commit e1ec57d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-flow

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ main() {
6767
# load common functionality
6868
. "$GITFLOW_DIR/gitflow-common"
6969

70+
# This environmental variable fixes non-POSIX getopt style argument
71+
# parsing, effectively breaking git-flow subcommand parsing on several
72+
# Linux platforms.
73+
export POSIXLY_CORRECT=1
74+
7075
# use the shFlags project to parse the command line arguments
7176
. "$GITFLOW_DIR/gitflow-shFlags"
7277
FLAGS_PARENT="git flow"

0 commit comments

Comments
 (0)