public class CommonCliOptions extends Object
Basic usage is: create an instance (usually a subclass if you want to all your own options or processing instructions), parse, and then use the resulting information.
See org.apache.hadoop.hive.service.HiveServer
or
HiveMetaStore
for examples of use.
Modifier and Type | Field and Description |
---|---|
protected String |
cliname
The name of this cli.
|
protected org.apache.commons.cli.CommandLine |
commandLine |
protected org.apache.commons.cli.Options |
OPTIONS
Options for parsing the command line.
|
Constructor and Description |
---|
CommonCliOptions(String cliname,
boolean includeHiveConf)
Create an instance with common options (help, verbose, etc...).
|
Modifier and Type | Method and Description |
---|---|
Properties |
addHiveconfToSystemProperties()
Add the hiveconf properties to the Java system properties, override
anything therein.
|
boolean |
isVerbose()
Should the client be verbose.
|
void |
parse(String[] args)
Parse the arguments.
|
void |
printUsage()
Print usage information for the CLI.
|
protected final org.apache.commons.cli.Options OPTIONS
protected org.apache.commons.cli.CommandLine commandLine
protected final String cliname
public CommonCliOptions(String cliname, boolean includeHiveConf)
cliname
- the name of the commandincludeHiveConf
- include "hiveconf" as an option if truepublic Properties addHiveconfToSystemProperties()
public void printUsage()
public void parse(String[] args)
args
- public boolean isVerbose()
Copyright © 2017 The Apache Software Foundation. All rights reserved.