Define our own extended CmdLineParser for extra parsing support
commitcfc49fafba6112c56080e5215138cf660fc7b7e1
authorShawn O. Pearce <spearce@spearce.org>
Fri, 18 Jul 2008 01:44:00 +0000 (17 21:44 -0400)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 23 Jul 2008 19:52:08 +0000 (23 21:52 +0200)
treeca7a728ef4016c8718cb42219f4c32384d71791b
parent5137dd5ffc1c86522e0a2f7aa6f387c4cef07780
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>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/opt/CmdLineParser.java [new file with mode: 0644]