From: Simon Hausmann Date: Sun, 25 Mar 2007 22:13:51 +0000 (+0200) Subject: Don't try to parse any options with git-p4 debug but pass it straight on to p4 X-Git-Tag: v1.5.3-rc0~65^2^2~148 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e20a9e530a02fefaec31b484bd224784b8814554;p=git.git Don't try to parse any options with git-p4 debug but pass it straight on to p4 Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 09990be37..5b023b1b7 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -1018,14 +1018,18 @@ except KeyError: options = cmd.options cmd.gitdir = gitdir -options.append(optparse.make_option("--git-dir", dest="gitdir")) -parser = optparse.OptionParser(cmd.usage.replace("%prog", "%prog " + cmdName), - options, - description = cmd.description, - formatter = HelpFormatter()) +args = sys.argv[2:] -(cmd, args) = parser.parse_args(sys.argv[2:], cmd); +if len(options) > 0: + options.append(optparse.make_option("--git-dir", dest="gitdir")) + + parser = optparse.OptionParser(cmd.usage.replace("%prog", "%prog " + cmdName), + options, + description = cmd.description, + formatter = HelpFormatter()) + + (cmd, args) = parser.parse_args(sys.argv[2:], cmd); gitdir = cmd.gitdir if len(gitdir) == 0: