public class CmdLineParser
extends org.kohsuke.args4j.CmdLineParser
The args4j package does not natively handle --foo=value and instead prefers to see --foo value on the command line. Many users are used to the GNU style --foo=value long option, so we convert from the GNU style format to the args4j style format prior to invoking args4j for parsing.
Constructor and Description |
---|
CmdLineParser(Object bean)
Creates a new command line owner that parses arguments/options and set
them into the given object.
|
CmdLineParser(Object bean,
Repository repo)
Creates a new command line owner that parses arguments/options and set
them into the given object.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
containsHelp(String... args)
Check if array contains help option
|
protected org.kohsuke.args4j.spi.OptionHandler |
createOptionHandler(org.kohsuke.args4j.OptionDef o,
org.kohsuke.args4j.spi.Setter setter) |
Repository |
getRepository()
Get the repository this parser translates values through.
|
RevWalk |
getRevWalk()
Get the revision walker used to support option parsing.
|
RevWalk |
getRevWalkGently()
Get the revision walker used to support option parsing.
|
void |
parseArgument(String... args) |
void |
printSingleLineUsage(Writer w,
ResourceBundle rb) |
addArgument, addOption, getArguments, getOptions, getProperties, isOption, parseArgument, printExample, printExample, printExample, printExample, printOption, printSingleLineUsage, printUsage, printUsage, printUsage, registerHandler, setUsageWidth, stopOptionParsing
public CmdLineParser(Object bean)
bean
- instance of a class annotated by
Option
and
Argument
. this object will receive
values.org.kohsuke.args4j.IllegalAnnotationError
- if the option bean class is using args4j annotations
incorrectly.public CmdLineParser(Object bean, Repository repo)
bean
- instance of a class annotated by
Option
and
Argument
. this object will receive
values.repo
- repository this parser can translate options through.org.kohsuke.args4j.IllegalAnnotationError
- if the option bean class is using args4j annotations
incorrectly.public void parseArgument(String... args) throws org.kohsuke.args4j.CmdLineException
parseArgument
in class org.kohsuke.args4j.CmdLineParser
org.kohsuke.args4j.CmdLineException
protected boolean containsHelp(String... args)
args
- non nullpublic Repository getRepository()
public RevWalk getRevWalk()
public RevWalk getRevWalkGently()
This method does not initialize the RevWalk and may return null.
protected org.kohsuke.args4j.spi.OptionHandler createOptionHandler(org.kohsuke.args4j.OptionDef o, org.kohsuke.args4j.spi.Setter setter)
createOptionHandler
in class org.kohsuke.args4j.CmdLineParser
public void printSingleLineUsage(Writer w, ResourceBundle rb)
printSingleLineUsage
in class org.kohsuke.args4j.CmdLineParser
Copyright © 2018 Eclipse JGit Project. All rights reserved.