本文整理汇总了Java中io.airlift.airline.Help类的典型用法代码示例。如果您正苦于以下问题:Java Help类的具体用法?Java Help怎么用?Java Help使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Help类属于io.airlift.airline包,在下文中一共展示了Help类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cli
import io.airlift.airline.Help; //导入依赖的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();
}
示例2: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
configureInMemoryLogging();
// argument parsing
io.airlift.airline.Cli.CliBuilder<Runnable> builder = io.airlift.airline.Cli.<Runnable>builder("eq3")
.withCommands(Help.class, Info.class, Discover.class, Version.class, Boost.class, Holiday.class)
.withDescription("Tool to manage Max!EQ3 cubes from the command line")
.withDefaultCommand(Help.class);
builder.withGroup("report")
.withDescription("Reporting to a configurable backend")
.withCommands(ReportCli.class)
.withDefaultCommand(Help.class);
io.airlift.airline.Cli<Runnable> gitParser = builder.build();
gitParser.parse(args).run();
// some parts do not exit correctly or daemon thread, this is why we need to call System.exit here
System.exit(0);
}
示例3: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
@SuppressWarnings("unchecked")
Cli.CliBuilder<Runnable> builder = Cli.<Runnable>builder("graphql-codegen")
.withDescription("GraphQL code generator CLI.")
.withDefaultCommand(Help.class)
.withCommands(
Langs.class,
Help.class
);
builder.withGroup("generate")
.withDescription("Generate code in chosen lang")
.withDefaultCommand(GenerateJava.class)
.withCommand(GenerateJava.class);
builder.build().parse(args).run();
}
示例4: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args)
throws Exception
{
TestingPrestoServerLauncher launcher = singleCommand(TestingPrestoServerLauncher.class).parse(args);
if (launcher.helpOption.showHelpIfRequested()) {
return;
}
try {
launcher.validateOptions();
}
catch (IllegalStateException e) {
System.out.println("ERROR: " + e.getMessage());
System.out.println();
Help.help(launcher.commandMetadata);
return;
}
launcher.run();
}
示例5: doMain
import io.airlift.airline.Help; //导入依赖的package包/类
boolean doMain(String[] args) {
Cli.CliBuilder<Runnable> builder = Cli.<Runnable>builder("streamsets jks-cs")
.withDescription("StreamSets Data Collector Java Keystore Credentials Store CLI")
.withDefaultCommand(Help.class)
.withCommands(
Help.class,
ListCredentialsCommand.class,
AddCredentialCommand.class,
DeleteCredentialCommand.class
);
try {
builder.build().parse(args).run();
return true;
} catch (Exception ex) {
if(Arrays.asList(args).contains("--stack")) {
ex.printStackTrace(System.err);
} else {
System.err.println(ex.getMessage());
}
return false;
}
}
示例6: main
import io.airlift.airline.Help; //导入依赖的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();
}
示例7: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args) {
String version = Version.readVersionFromResources();
@SuppressWarnings("unchecked")
Cli.CliBuilder<Runnable> builder =
Cli.<Runnable>builder("Swagger-Diff")
.withDescription(
String.format(
"Swagger Diff CLI (version %s).",
version))
.withDefaultCommand(Diff.class)
.withCommands(Diff.class, Help.class, Version.class);
builder.build().parse(args).run();
}
示例8: main
import io.airlift.airline.Help; //导入依赖的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();
}
示例9: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args)
throws Throwable
{
@SuppressWarnings({"unchecked"})
Cli.CliBuilder<Runnable> builder = Cli.<Runnable>builder("wava")
.withDescription("WebAssembly for Java")
.withDefaultCommand(Help.class)
.withCommands(
Help.class,
TranslateCommand.class);
Cli<Runnable> parser = builder.build();
parser.parse(args).run();
}
示例10: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args)
{
Cli.CliBuilder<Runnable> builder = Cli.<Runnable> builder("alfclient")
.withDescription("Sample Alfresco Command Line Client").withDefaultCommand(Help.class)
.withCommands(Help.class, AlfrescoCommands.infoUser.class)
.withCommands(Help.class, AlfrescoCommands.listRoot.class);
Cli<Runnable> gitParser = builder.build();
gitParser.parse(args).run();
}
示例11: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String args[]) throws Exception {
Cli.CliBuilder<Runnable> builder = Cli.<Runnable>builder("minijavac")
.withDescription("A Java compiler for a worse version of Java.")
.withDefaultCommand(Help.class)
.withCommands(
LexCommand.class,
ParseCommand.class,
TypecheckCommand.class,
GenerateCodeCommand.class);
builder.build().parse(args).run();
}
示例12: main
import io.airlift.airline.Help; //导入依赖的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()));
}
}
示例13: helpGroup
import io.airlift.airline.Help; //导入依赖的package包/类
protected void helpGroup(String groupName, String commandName) {
for (CommandGroupMetadata group : global.getCommandGroups()) {
if (group.getName().equals(groupName)) {
for (CommandMetadata command : group.getCommands()) {
if (command.getName().equals(commandName)) {
Help.help(command);
}
}
break;
}
}
}
示例14: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args) {
Cli.CliBuilder<Runnable> builder = Cli.<Runnable>builder("swagger")
.withDescription("Swagger code generator CLI. More info on swagger.io")
.withCommands(
Generate.class,
Help.class
);
builder.build().parse(args).run();
}
示例15: main
import io.airlift.airline.Help; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
Cli.<Callable>builder("muckery")
.withCommands(Help.class, Main.class)
.withDefaultCommand(Help.class)
.build()
.parse(args)
.call();
}