public HostDeregisterCommand(Subparser parser) { super(parser); parser.help("deregister a host"); hostArg = parser.addArgument("host") .help("Host name to deregister."); yesArg = parser.addArgument("--yes") .action(Arguments.storeTrue()) .help("Automatically answer 'yes' to the interactive prompt."); }
@Override public void configure(Subparser subparser) { for (AbstractLiquibaseCommand<T> subcommand : subcommands.values()) { final Subparser cmdParser = subparser.addSubparsers() .addParser(subcommand.getName()) .setDefault(COMMAND_NAME_ATTR, subcommand.getName()) .description(subcommand.getDescription()); subcommand.configure(cmdParser); } }
ControlCommand(final Subparser parser, final boolean shortCircuit) { parser.setDefault("command", this).defaultHelp(true); this.shortCircuit = shortCircuit; }
public JobHistoryCommand(Subparser parser) { super(parser); parser.help("see the run history of a job"); jobIdArg = parser.addArgument("jobid") .help("Job id"); }
public DeploymentGroupStopCommand(final Subparser parser) { super(parser); parser.help("Stop a deployment-group or abort a rolling-update"); nameArg = parser.addArgument("name") .required(true) .help("Deployment group name"); }
@Override public void configure(Subparser subparser) { super.configure(subparser); subparser.addArgument("-c", "--count") .dest("count") .type(Integer.class) .help("limit script to the specified number of pending change sets"); subparser.addArgument("-i", "--include") .action(Arguments.append()) .dest("contexts") .help("include change sets from the given context"); }
/** * Initialize the arg parser for the Sort sub command * * @param subparsers The Subparsers object to attach the new Subparser to */ @Override public void intializeSubCommand( Subparsers subparsers ) { Subparser sortParser = subparsers.addParser( "sort" ) .description( "Jolt CLI Sort Tool. This tool will ingest one JSON input (from a file or standard input) and " + "perform the Jolt sort operation on it. The sort order is standard alphabetical ascending, with a " + "special case for \"~\" prefixed keys to be bumped to the top. The program will return an exit code " + "of 0 if the sort operation is performed successfully or a 1 if an error is encountered." ) .defaultHelp( true ); sortParser.addArgument( "input" ).help( "File path to the input JSON that the sort operation should be performed on. " + "This file should contain valid JSON. " + "If this argument is not specified then standard input will be used." ) .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() ) .nargs( "?" ).setDefault( (File) null ).required( false ); // these last two method calls make input optional sortParser.addArgument( "-u" ).help( "Turns off pretty print for the output. Output will be raw json with no formatting." ) .action( Arguments.storeTrue() ); }
public DeploymentGroupCreateCommand(final Subparser parser) { super(parser); parser.help("create a deployment group"); nameArg = parser.addArgument("name") .required(true) .help("Deployment group name"); hostSelectorsArg = parser.addArgument("host_selectors") .action(append()) .setDefault(Lists.newArrayList()) .nargs("+") .help("Host selector expression. Hosts matching this expression will be part of the " + "deployment-group. Multiple conditions can be specified, separated by spaces (as " + "separate arguments). If multiple conditions are given, all must be fulfilled. " + "Operators supported are =, !=, in and notin. Example: foo=bar baz!=qux"); quietArg = parser.addArgument("-q") .action(storeTrue()) .help("only print job id"); }
/** * Setup {@link ArgumentParser} * * @param subParsers * {@link Subparsers} to setup */ public static void setupParser(Subparsers subParsers) { BiFunction<String[], Namespace, DatabaseListCommand> handler = (argv, args) -> { try { return new DatabaseListCommand(argv, args); } catch (CommandLineParsingException e) { throw new UncheckedJannovarException("Could not parse command line", e); } }; Subparser subParser = subParsers.addParser("db-list", true).help("list databases available for download") .setDefault("cmd", handler); subParser.description("List databases available for download"); ArgumentGroup optionalGroup = subParser.addArgumentGroup("Optional Arguments"); optionalGroup.addArgument("-s", "--data-source-list").help("INI file with data source list") .setDefault(Lists.newArrayList("bundle:///default_sources.ini")).action(Arguments.append()); JannovarBaseOptions.setupParser(subParser); }
Subparser subParser = subParsers.addParser("annotate-vcf", true).help("annotate VCF files") .setDefault("cmd", handler); subParser.description("Perform annotation of a single VCF file"); ArgumentGroup requiredGroup = subParser.addArgumentGroup("Required arguments"); requiredGroup.addArgument("-i", "--input-vcf").help("Path to input VCF file") .required(true); requiredGroup.addArgument("-o", "--output-vcf").help("Path to output VCF file") .addArgumentGroup("Annotation Arguments (optional)"); .required(false).setDefault(false).action(Arguments.storeTrue()); .setDefault(false).action(Arguments.storeTrue()); .addArgumentGroup("Annotation with dbNSFP (experimental; optional)"); .addArgumentGroup("BED-based Annotation (experimental; optional)"); .addArgumentGroup("Generic VCF-based Annotation (experimental; optional)"); .addArgumentGroup("TSV-based Annotation (experimental; optional)"); .addArgumentGroup("Threshold-filter related arguments"); ArgumentGroup offTargetGroup = subParser.addArgumentGroup("Exome on/off target filters"); ArgumentGroup optionalGroup = subParser.addArgumentGroup("Other, optional Arguments");
.setDefault(COMMAND, command) .help(command.help()); .setDefault(COMMAND, command) .help(command.help()); split.addArgument("osm_file").required(true) split.addArgument("compression").required(false).nargs("?").choices("none", "gzip", "bz2") split.addArgument("--append").required(false).setDefault(Boolean.FALSE) .setDefault(COMMAND, command) .help(command.help()); slice.addArgument(POI_CATALOG_OPT).setDefault("jar") slice.addArgument(EXCCLUDE_POI_BRANCH_OPT).nargs("*") slice.addArgument(NAMED_POI_BRANCH_OPT).nargs("*") slice.addArgument(FEATURE_TYPES_VAL).help("Parse and slice axact feature(s) type.") slice.addArgument("--drop").nargs("*") slice.addArgument(BOUNDARIES_FALLBACK_PARAM).nargs("?") slice.addArgument(BOUNDARIES_FALLBACK_TYPES_PARAM).nargs("*")
Subparser subParser = subParsers.addParser("annotate-csv", true).help("Annotate a csv file").setDefault("cmd", handler); subParser.description("Perform annotation of genomic changes given on the command line"); ArgumentGroup requiredGroup = subParser.addArgumentGroup("Required arguments"); requiredGroup.addArgument("-d", "--database").help("Path to database .ser file").required(true); requiredGroup.addArgument("-i", "--input").help("CSV file").required(true); requiredGroup.addArgument("-c", "--chr").type(Integer.class).help("Column of chr (1 based)").required(true); requiredGroup.addArgument("-p", "--pos").type(Integer.class).help("Column of pos (1 based)").required(true); requiredGroup.addArgument("-r", "--ref").type(Integer.class).help("Column of ref (1 based)").required(true); requiredGroup.addArgument("-a", "--alt").type(Integer.class).help("Column of alt (1 based)").required(true); ArgumentGroup optionalGroup = subParser.addArgumentGroup("Additional CSV arguments (optional)"); optionalGroup.addArgument("-t", "--type").type(CSVFormat.Predefined.class) .choices(CSVFormat.Predefined.Default, CSVFormat.Predefined.TDF, CSVFormat.Predefined.RFC4180, .help("Type of csv file. ").setDefault(CSVFormat.Predefined.Default); optionalGroup.addArgument("--header").help("Set if the file contains a header. ").setDefault(false) .action(Arguments.storeTrue()); subParser.epilog( "Example: java -jar Jannovar.jar annotate-csv -d hg19_refseq.ser -c 1 -p 2 -r 3 -r 4 -t TDF --header -i input.csv");
public JobStartCommand(Subparser parser) { super(parser); parser.help("start a stopped job"); hostsArg = parser.addArgument("hosts") .nargs("+") .help("The hosts to start the job on."); tokenArg = parser.addArgument("--token") .nargs("?") .setDefault("") .help("Insecure access token"); }
.help("project transcript-level to chromosome-level changes").setDefault("cmd", handler); subParser.description("Project transcript-level changes to chromosome level ones"); ArgumentGroup requiredGroup = subParser.addArgumentGroup("Required arguments"); requiredGroup.addArgument("-r", "--reference-fasta").help("Path to reference FASTA file").required(true); requiredGroup.addArgument("-d", "--database").help("Path to database .ser file").required(true); requiredGroup.addArgument("-i", "--input-txt").help("Input file with HGVS transcript-level changes, line-by-line") .required(true); .required(true); ArgumentGroup optionalGroup = subParser.addArgumentGroup("Optional Arguments"); optionalGroup.addArgument("--show-all").help("Show all effects").setDefault(false); optionalGroup.addArgument("--no-3-prime-shifting").help("Disable shifting towards 3' of transcript") .dest("3_prime_shifting").setDefault(true).action(Arguments.storeFalse()); optionalGroup.addArgument("--3-letter-amino-acids").help("Enable usage of 3 letter amino acid codes") .setDefault(false).action(Arguments.storeTrue()); subParser.epilog("Example: java -jar Jannovar.jar tx-to-chrom -i in.txt -o out.vcf");
super.configure(subparser); subparser.addArgument("-o", "--output") .dest("output") .help("Write output to <file> instead of stdout"); final ArgumentGroup tables = subparser.addArgumentGroup("Tables"); tables.addArgument("--tables") .action(Arguments.storeTrue()) final ArgumentGroup columns = subparser.addArgumentGroup("Columns"); columns.addArgument("--columns") .action(Arguments.storeTrue()) final ArgumentGroup views = subparser.addArgumentGroup("Views"); final ArgumentGroup primaryKeys = subparser.addArgumentGroup("Primary Keys"); final ArgumentGroup uniqueConstraints = subparser.addArgumentGroup("Unique Constraints"); final ArgumentGroup indexes = subparser.addArgumentGroup("Indexes"); final ArgumentGroup foreignKeys = subparser.addArgumentGroup("Foreign Keys"); final ArgumentGroup sequences = subparser.addArgumentGroup("Sequences"); final ArgumentGroup data = subparser.addArgumentGroup("Data");
@Override public void configure(Subparser subparser) { super.configure(subparser); subparser.addArgument("-u", "--user") .dest("user") .type(String.class) .required(true) .help("The user to remove"); }
@Override public void configure(Subparser subparser) { super.configure(subparser); subparser.addArgument("tag-name") .dest("tag-name") .nargs(1) .required(true) .help("The tag name"); }
subparser.defaultHelp(true) .description("Workload generator for socialite social data platform"); subparser.addArgument("--total_users") .required(true) .type(Integer.class) .help("Total number of users that exist"); subparser.addArgument("--active_users") subparser.addArgument("--session_duration") subparser.addArgument("--concurrency") subparser.addArgument("--target_rate") subparser.addArgument("--follow_pct") subparser.addArgument("--unfollow_pct") subparser.addArgument("--read_timeline_pct") subparser.addArgument("--scroll_timeline_pct") subparser.addArgument("--send_content_pct") subparser.addArgument("--fof_agg_pct") subparser.addArgument("--fof_query_pct")
@Override public void configure(Subparser subparser) { subparser.addArgument(DEMO_ARG_NAME) .dest(DEMO_ARG_NAME) .action(Arguments.storeConst()) .setConst(true) .setDefault(false) .help("Generate application with a demo spec"); }
/** * Adds the configuration file argument for the configured command. * @param subparser The subparser to register the argument on * @return the register argument */ protected Argument addFileArgument(Subparser subparser) { return subparser.addArgument("file") .nargs("?") .help("application configuration file"); }