Merge pull request #8685 from brianjmurrell/patch-1

Clear POSIXLY_CORRECT when using optparse
This commit is contained in:
Brian Cain 2017-09-29 14:12:17 -07:00 committed by GitHub
commit ef040f6f82
1 changed files with 3 additions and 0 deletions

View File

@ -43,6 +43,9 @@ module Vagrant
# If this method returns `nil`, then you should assume that help
# was printed and parsing failed.
def parse_options(opts=nil)
# make sure optparse doesn't use POSIXLY_CORRECT parsing
ENV["POSIXLY_CORRECT"] = nil
# Creating a shallow copy of the arguments so the OptionParser
# doesn't destroy the originals.
argv = @argv.dup