net.sourceforge.argparse4j.inf.Argument.help()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中net.sourceforge.argparse4j.inf.Argument.help()方法的一些代码示例,展示了Argument.help()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Argument.help()方法的具体详情如下:
包路径:net.sourceforge.argparse4j.inf.Argument
类名称:Argument
方法名:help

Argument.help介绍

[英]Sets the brief description of what the argument does.
[中]设置参数作用的简要说明。

代码示例

代码示例来源:origin: dropwizard/dropwizard

/**
 * 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");
}

代码示例来源:origin: spotify/helios

public HostRegisterCommand(final Subparser parser) {
 super(parser);
 parser.help("register a host");
 hostArg = parser.addArgument("host")
   .help("The hostname of the agent you want to register with the Helios masters.");
 idArg = parser.addArgument("id")
   .help("A unique ID for this host.");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("--migrations")
      .dest("migrations-file")
      .help("the file containing the Liquibase migrations for the application");
  subparser.addArgument("--catalog")
      .dest("catalog")
      .help("Specify the database catalog (use database default if omitted)");
  subparser.addArgument("--schema")
      .dest("schema")
      .help("Specify the database schema (use database default if omitted)");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("id").nargs(1).help("change set id");
  subparser.addArgument("author").nargs(1).help("author name");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("output").nargs(1).help("output directory");
}

代码示例来源:origin: spotify/helios

public JobStatusCommand(final Subparser parser) {
 super(parser);
 parser.help("show job or host status");
 jobArg = parser.addArgument("-j", "--job")
   .help("Job filter");
 hostArg = parser.addArgument("--host")
   .setDefault("")
   .help("Host pattern");
 fullArg = parser.addArgument("-f")
   .action(storeTrue())
   .help("Print full hostnames, job and container id's.");
}

代码示例来源:origin: spotify/helios

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.");
}

代码示例来源:origin: dropwizard/dropwizard

private void addHelp(ArgumentParser p) {
  p.addArgument("-h", "--help")
    .action(new SafeHelpAction(stdOut))
    .help("show this help message and exit")
    .setDefault(Arguments.SUPPRESS);
}

代码示例来源:origin: dropwizard/dropwizard

@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");
}

代码示例来源:origin: spotify/helios

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");
}

代码示例来源:origin: spotify/helios

public DeploymentGroupRemoveCommand(final Subparser parser) {
 super(parser);
 parser.help("remove a deployment-group. Note that this does not undeploy jobs previously "
       + "deployed by the deployment-group");
 nameArg = parser.addArgument("deployment-group-name")
   .required(true)
   .help("Deployment group name");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("-v", "--verbose")
       .action(Arguments.storeTrue())
       .dest("verbose")
       .help("Output verbose information");
  subparser.addArgument("-i", "--include")
       .action(Arguments.append())
       .dest("contexts")
       .help("include change sets from the given context");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("--confirm-delete-everything")
       .action(Arguments.storeTrue())
       .required(true)
       .help("indicate you understand this deletes everything in your database");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("-i", "--include")
       .action(Arguments.append())
       .dest("contexts")
       .help("include change sets from the given context");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("tag-name")
      .dest("tag-name")
      .nargs(1)
      .required(true)
      .help("The tag name");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("-n", "--dry-run")
       .action(Arguments.storeTrue())
       .dest("dry-run")
       .setDefault(Boolean.FALSE)
       .help("output the DDL to stdout, don't run it");
  subparser.addArgument("-c", "--count")
       .type(Integer.class)
       .dest("count")
       .help("only apply the next N change sets");
  subparser.addArgument("-i", "--include")
       .action(Arguments.append())
       .dest("contexts")
       .help("include change sets from the given context");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("-l", "--list")
       .dest("list")
       .action(Arguments.storeTrue())
       .setDefault(Boolean.FALSE)
       .help("list all open locks");
  subparser.addArgument("-r", "--force-release")
       .dest("release")
       .action(Arguments.storeTrue())
       .setDefault(Boolean.FALSE)
       .help("forcibly release all open locks");
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("-n", "--dry-run")
       .action(Arguments.storeTrue())
       .dest("dry-run")
       .setDefault(Boolean.FALSE)
       .help("output the DDL to stdout, don't run it");
  subparser.addArgument("-a", "--all")
       .action(Arguments.storeTrue())
       .dest("all")
       .setDefault(Boolean.FALSE)
       .help("mark all pending change sets as applied");
  subparser.addArgument("-i", "--include")
       .action(Arguments.append())
       .dest("contexts")
       .help("include change sets from the given context");
}

代码示例来源:origin: dropwizard/dropwizard

private ArgumentParser buildParser(JarLocation location) {
  final String usage = "java -jar " + location;
  final ArgumentParser p = ArgumentParsers.newFor(usage).addHelp(false).build();
  p.version(location.getVersion().orElse(
      "No application version detected. Add a Implementation-Version " +
          "entry to your JAR's manifest to enable this."));
  addHelp(p);
  p.addArgument("-v", "--version")
    .action(Arguments.help()) // never gets called; intercepted in #run
    .help("show the application version and exit");
  return p;
}

代码示例来源:origin: dropwizard/dropwizard

@Override
public void configure(Subparser subparser) {
  super.configure(subparser);
  subparser.addArgument("-i", "--include-default")
       .action(Arguments.storeTrue())
       .dest("include-default")
       .help("Also render the template with the default name");
  subparser.addArgument("names").nargs("*");
}

相关文章