Define our own extended CmdLineParser for extra parsing support
commit4f750dd62037f77abd7b8a797e58e537526f4e88
authorShawn O. Pearce <spearce@spearce.org>
Thu, 17 Jul 2008 22:26:36 +0000 (17 18:26 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 18 Jul 2008 01:43:28 +0000 (17 21:43 -0400)
tree7a88c650f7de01444c6958518ade1c347c48243a
parente25801df498811f59583f9d3524068d64f2e7b92
Define our own extended CmdLineParser for extra parsing support

A specialized CmdLineParser subclass is used to automatically handle
`--git-dir=foo`, as args4j wants to see `--git-dir foo` instead.
We split on the first equal sign on a long option and use that to
delimit the value from the option name.

We stop this long option fixup at the first -- found on the command
line, as this is a traditional delimiter between options and only
arguments.  This is an assumption that all of our users of a command
line parser support would want to terminate option parsing at the
first -- they see on the command line, and thus it is OK to stop
our GNU long optino style cleanup.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/opt/CmdLineParser.java [new file with mode: 0644]