Events-cli: Difference between revisions
Jump to navigation
Jump to search
(→Maven) |
|||
Line 17: | Line 17: | ||
=User Manual= | =User Manual= | ||
Usage: | |||
<syntaxhighlight lang='java'> | |||
public class Main { | |||
public static final String APPLICATION_NAME = "some-app"; | |||
public static void main(String[] args) throws Exception { | |||
try { | |||
Parser parser = new SomeAppParser(); | |||
ProcedureFactory procedureFactory = new SomeAppProcedureFactory(); | |||
EventParserRuntime runtime = new EventParserRuntime(args, APPLICATION_NAME, procedureFactory, parser); | |||
if (runtime.getConfiguration().isHelp()) { | |||
runtime.displayHelp(APPLICATION_NAME); | |||
return; | |||
} | |||
runtime.run(); | |||
} | |||
catch(UserErrorException e) { | |||
System.err.println(e.getMessage()); | |||
} | |||
} | |||
</syntaxhighlight> | |||
=Development= | =Development= |
Revision as of 19:36, 14 August 2017
Internal
Overview
Command line logic for event parsers.
Enforces the following command line structure:
<parser> [command] [command-options] [query] <file1> [<file2> ...]
cat <input-file> | <parser> [command] [command-options] [query]
where the commands represent events-processing procedures.
User Manual
Usage:
public class Main {
public static final String APPLICATION_NAME = "some-app";
public static void main(String[] args) throws Exception {
try {
Parser parser = new SomeAppParser();
ProcedureFactory procedureFactory = new SomeAppProcedureFactory();
EventParserRuntime runtime = new EventParserRuntime(args, APPLICATION_NAME, procedureFactory, parser);
if (runtime.getConfiguration().isHelp()) {
runtime.displayHelp(APPLICATION_NAME);
return;
}
runtime.run();
}
catch(UserErrorException e) {
System.err.println(e.getMessage());
}
}
Development
GitHub
Maven
<dependency> <groupId>io.novaordis.events.cli</groupId> <artifactId>events-cli</artifactId> <version>${events.cli.version}</version> </dependency>