@Command(name = "version", description = "Show the Graylog and JVM versions") public class ShowVersion implements CliCommand { private final Version version = Version.CURRENT_CLASSPATH; @Override public void run() { System.out.println("Graylog " + version); System.out.println("JRE: " + Tools.getSystemInformation()); } }
protected CmdLineTool(String commandName, BaseConfiguration configuration) { jadConfig = new JadConfig(); jadConfig.addConverterFactory(new GuavaConverterFactory()); jadConfig.addConverterFactory(new JodaTimeConverterFactory()); if (commandName == null) { if (this.getClass().isAnnotationPresent(Command.class)) { this.commandName = this.getClass().getAnnotation(Command.class).name(); } else { this.commandName = "tool"; } } else { this.commandName = commandName; } this.configuration = configuration; this.chainingClassLoader = new ChainingClassLoader(this.getClass().getClassLoader()); }
String name = command.name(); String description = command.description().isEmpty() ? null : command.description(); List<String> groupNames = Arrays.asList(command.groupNames()); boolean hidden = command.hidden();
@SuppressWarnings("LocalCanBeFinal") @Command(name = "show", description = "Shows information about the persisted message journal") public class JournalShow extends AbstractJournalCommand {
protected CmdLineTool(String commandName, BaseConfiguration configuration) { jadConfig = new JadConfig(); jadConfig.addConverterFactory(new GuavaConverterFactory()); jadConfig.addConverterFactory(new JodaTimeConverterFactory()); if (commandName == null) { if (this.getClass().isAnnotationPresent(Command.class)) { this.commandName = this.getClass().getAnnotation(Command.class).name(); } else { this.commandName = "tool"; } } else { this.commandName = commandName; } this.configuration = configuration; this.chainingClassLoader = new ChainingClassLoader(this.getClass().getClassLoader()); }
@Command(name = "truncate", description = "Truncates the journal to a given offset") public class JournalTruncate extends AbstractJournalCommand { @Option(name = {"-o", "--offset"}, description = "Truncate journal up to this offset, no remaining offset will be larger than the given offset.") @Required private long offset = Long.MIN_VALUE; public JournalTruncate() { super("truncate-journal"); } @Override protected void runCommand() { try { final long logEndOffset = journal.getLogEndOffset(); if (offset > logEndOffset) { System.err.println("Truncating journal to " + offset + " has no effect as the largest offset in the log is " + (logEndOffset - 1) + "."); } else { journal.truncateTo(offset); } } catch (IllegalArgumentException e) { System.err.println("Illegal offset value " + offset); } } }
@Command(name = "server", description = "Start the Graylog server") public class Server extends ServerBootstrap { private static final Logger LOG = LoggerFactory.getLogger(Server.class);
@Command(name = "decode", description = "Decodes messages from the journal") public class JournalDecode extends AbstractJournalCommand {
@Command(name = "server", description = "KSQL Cluster") public class ServerOptions {
@Command(name = "ksql", description = "KSQL CLI") public class Options {
@Command(name = "compile", description = "compile the ontology axioms into mappings", hidden = true) public class OntopCompile implements OntopCommand { @Override public void run() { } }
@Command(name = "--version", description = "Show version of ontop") public class OntopVersion implements OntopCommand{ @Override public void run() { //String version = getClass().getPackage().getImplementationVersion(); VersionInfo versionInfo = VersionInfo.getVersionInfo(); System.out.println(String.format("ontop version %s", versionInfo.toString())); } }
@Command(name = "version", description = "Show the Graylog and JVM versions") public class ShowVersion implements CliCommand { private final Version version = Version.CURRENT_CLASSPATH; @Override public void run() { System.out.println("Graylog " + version); System.out.println("JRE: " + Tools.getSystemInformation()); } }
@Command(name = "remote", description = "A command whose name is similar to other command names") public class CommandRemote { @Inject public CommandMain commandMain; }
@Command(name = "remotes", description = "A command whose name is an extension of another commands name") public class CommandRemotes { @Inject public CommandMain commandMain; }
@Command(name = "command") public static class CommandTest { public static class Delegate { @Option(name = "-a") public String a = "b"; } @Inject public Delegate delegate = new Delegate(); }
@Command(name = "help", description = "Display help information about galaxy") public static class HelpCommand extends GalaxyCommand { @Inject public Help<GalaxyCommand> help; @Override public void execute() { help.call(); } }
@Command(name = "command") public static class NullDelegatesAreProhibited { public static class ComplexDelegate { @Option(name = "-a") public boolean a; } @Inject public ComplexDelegate delegate; }
@Command(name = "ArgsMergeOverride") public class ArgsMergeOverride extends ArgsMergeAddition { /** * This is a legal option override because we explicitly stated that override is true */ @Option(name = "--hidden", description = "A now visible option", override = true) public boolean hidden = false; }
@Command(name = "ArgsExitCodes", description = "ArgsExitCodes description") @ExitCodes(codes = { 0, 1, 2}, descriptions = { "Success", "", "Error 2" }) public class ArgsExitCodes { }