当前位置: 首页>>代码示例>>Java>>正文


Java CliBuilder类代码示例

本文整理汇总了Java中io.airlift.airline.Cli.CliBuilder的典型用法代码示例。如果您正苦于以下问题:Java CliBuilder类的具体用法?Java CliBuilder怎么用?Java CliBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CliBuilder类属于io.airlift.airline.Cli包,在下文中一共展示了CliBuilder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cli

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
private static Cli<Runnable> cli() {
  final CliBuilder<Runnable> builder = Cli.builder("grpc-proxy");

  builder
      .withDescription("A set of example services for testing a gRPC proxy service.")
      .withDefaultCommand(Help.class)
      .withCommand(Help.class)
      .withCommand(HelloWorldClient.Cmd.class);

  builder
      .withGroup("server")
      .withDescription("Run a server")
      .withDefaultCommand(Help.class)
      .withCommand(Help.class)
      .withCommand(ProxyRpcServer.Cmd.class)
      .withCommand(LegacyHttpServer.Cmd.class)
      .withCommand(HelloWorldServer.Cmd.class);

  return builder.build();
}
 
开发者ID:codahale,项目名称:grpc-proxy,代码行数:21,代码来源:Runner.java

示例2: main

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
public static void main(String[] args) {
    CliBuilder<Runnable> builder = Cli.<Runnable> builder("proxy")
        .withDefaultCommand(Help.class)
        .withCommand(Help.class)
        .withCommand(ApnsProxyCommand.class)
        .withCommand(FCMProxyCommand.class);

    builder.build().parse(args).run();
}
 
开发者ID:aerogear,项目名称:push-network-proxies,代码行数:10,代码来源:ProxyCLI.java

示例3: main

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
public static void main(String[] args) throws RunnerException {
    CliBuilder<Runnable> builder = io.airlift.airline.Cli.<Runnable>builder("bench")
        .withDescription("Benchmark JSON libraries")
        .withDefaultCommand(Help.class)
        .withCommands(Help.class, InfoCommand.class, SerializationCommand.class, DeserializationCommand.class);

    io.airlift.airline.Cli<Runnable> gitParser = builder.build();
    gitParser.parse(args).run();
}
 
开发者ID:fabienrenaud,项目名称:java-json-benchmark,代码行数:10,代码来源:Cli.java

示例4: main

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
public static void main(String[] args) {

    final CliBuilder<Runnable> builder = Cli.builder("jgql");

    builder.withDescription("GraphQL Toolkit");
    builder.withDefaultCommand(Help.class);

    final List<Class<? extends Runnable>> cmds = new LinkedList<>();

    cmds.add(Help.class);

    cmds.add(ExtractSchema.class);
    cmds.add(GenerateClientCode.class);

    cmds.add(RegistryPush.class);
    cmds.add(RegistryGet.class);
    cmds.add(RegistryMonitor.class);
    cmds.add(RunQuery.class);
    cmds.add(Diff.class);
    cmds.add(TestSchema.class);

    builder.withCommands(cmds);

    final Cli<Runnable> parser = builder.build();

    try {
      parser.parse(args).run();
    } catch (final ParseException e) {
      System.err.print(e.getMessage());
      System.err.println(String.format(".  See '%s help'.", self()));
    }

  }
 
开发者ID:zourzouvillys,项目名称:graphql,代码行数:34,代码来源:CommandLineMain.java

示例5: parser

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
private static Cli<TvnLangTool> parser() {
	CliBuilder<TvnLangTool> build = Cli.<TvnLangTool> builder("tavlang")
			.withDescription("Convert, manage workflows")
			.withDefaultCommand(HelpCommand.class)
			.withCommand(CommandConvert.class) // Conversion
			.withCommand(HelpCommand.class) // Help
			.withCommand(CommandInspect.class) // Inspect
			.withCommand(CommandValidate.class) // Validate
			.withCommand(CommandVersion.class) // Version
			.withCommand(CommandStat.class); // Statistics

	return build.build();
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:14,代码来源:CommandLineTool.java

示例6: main

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
public static void main(String[] args) {
    CliBuilder<Runnable> builder = Cli.<Runnable>builder("strongbox")
            .withDescription("Strongbox")
            .withDefaultCommand(Help.class)
            .withCommands(Help.class);

    builder.withCommand(Global.CustomHelp.class);
    builder.withCommand(Global.Version.class);
    builder.withCommand(Global.VersionOption.class);

    builder.withGroup("group")
            .withDescription("Manage Secret Groups")
            .withDefaultCommand(Group.GroupHelp.class)
            .withCommands(Group.Create.class, Group.List.class, Group.Info.class, Group.Delete.class, Group.AttachAdmin.class, Group.DetachAdmin.class, Group.AttachReadOnly.class, Group.DetachReadOnly.class, Group.BackupCommand.class, Group.RestoreCommand.class, Group.MigrateCommand.class);

    builder.withGroup("secret")
            .withDescription("Manage Secrets for a Secret Group")
            .withDefaultCommand(Secret.SecretHelp.class)
            .withCommands(Secret.Create.class, Secret.AddVersion.class, Secret.Get.class, Secret.GetLatest.class, Secret.Delete.class, Secret.ListNames.class, Secret.ListVersions.class, Secret.Update.class);

    builder.withCommand(Gui.OpenGui.class);

    Cli<Runnable> parser = builder.build();
    globalMetadata = parser.getMetadata();

    try {
        parser.parse(args).run();
    } catch (ParseArgumentsUnexpectedException exception) {
        Optional<String> globalOptions = exception.getUnparsedInput().stream()
                .filter(Global.Option::contains)
                .findAny();

        System.err.println(exception.getMessage());
        if (globalOptions.isPresent()) {
            System.err.println(String.format(
                    "Please note: global options like '%s' must be placed before the command,\n" +
                    "  e.g. 'strongbox --global-option [global-option-value] <command> [<args>]'\n" +
                    "  see 'strongbox help <command>' for more information about ordering.",
                    globalOptions.get()));
        } else {
            System.err.println("See 'strongbox help'.");
        }

        System.exit(1);
    } catch (Exception e) {
        boolean stacktrace = stacktraceIsSet(parser.getMetadata(), args);

        if (!stacktrace) {
            System.err.println(e.getMessage());
            System.exit(1);
        }
        throw e;
    }
}
 
开发者ID:schibsted,项目名称:strongbox,代码行数:55,代码来源:StrongboxCLI.java

示例7: main

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
public static void main(String[] args) {
  CliBuilder<Runnable> builder = Cli.<Runnable>builder("denominator")
      .withDescription("Denominator: Portable control of DNS clouds")
      .withDefaultCommand(Help.class)
      .withCommand(Help.class)
      .withCommand(PrintVersion.class)
      .withCommand(ListProviders.class);

  builder.withGroup("zone")
      .withDescription("manage zones")
      .withDefaultCommand(ZoneList.class)
      .withCommand(ZoneList.class)
      .withCommand(ZoneAdd.class)
      .withCommand(ZoneUpdate.class)
      .withCommand(ZoneDelete.class);

  builder.withGroup("record")
      .withDescription("manage resource record sets in a zone")
      .withDefaultCommand(ResourceRecordSetList.class)
      .withCommand(ResourceRecordSetList.class)
      .withCommand(ResourceRecordSetGet.class)
      .withCommand(ResourceRecordSetAdd.class)
      .withCommand(ResourceRecordSetApplyTTL.class)
      .withCommand(ResourceRecordSetReplace.class)
      .withCommand(ResourceRecordSetRemove.class)
      .withCommand(ResourceRecordSetDelete.class);

  builder.withGroup("geo")
      .withDescription("manage geo resource record sets in a zone")
      .withDefaultCommand(GeoResourceRecordSetList.class)
      .withCommand(GeoTypeList.class)
      .withCommand(GeoRegionList.class)
      .withCommand(GeoResourceRecordSetList.class)
      .withCommand(GeoResourceRecordSetGet.class)
      .withCommand(GeoResourceRecordSetApplyTTL.class)
      .withCommand(GeoResourceRecordAddRegions.class);

  Cli<Runnable> denominatorParser = builder.build();
  try {
    denominatorParser.parse(args).run();
  } catch (RuntimeException e) {
    if (e instanceof NullPointerException) {
      e.printStackTrace();
    }
    System.err.println(";; error: " + e.getMessage());
    System.exit(1);
  }
  System.exit(0);
}
 
开发者ID:Netflix,项目名称:denominator,代码行数:50,代码来源:Denominator.java

示例8: main

import io.airlift.airline.Cli.CliBuilder; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void main(String[] args) {

    CliBuilder<Runnable> builder = Cli.<Runnable>builder("export")
            .withDescription("Export a KahaDB or MultiKahaDB store to Artemis XML")
            .withDefaultCommand(Help.class)
            .withCommands(Help.class, ExportKahaDb.class, ExportMultiKahaDb.class);

    Cli<Runnable> gitParser = builder.build();

    gitParser.parse(args).run();

}
 
开发者ID:apache,项目名称:activemq-cli-tools,代码行数:14,代码来源:Exporter.java


注:本文中的io.airlift.airline.Cli.CliBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。