Search in sources :

Example 1 with DefaultConsole

use of com.beust.jcommander.internal.DefaultConsole in project quality-measure-and-cohort-service by Alvearie.

the class TranslationCLI method main.

public static void main(String[] args) throws Exception {
    TranslationOptions options = new TranslationOptions();
    JCommander jc = JCommander.newBuilder().programName("cql-translation").console(new DefaultConsole(System.out)).addObject(options).build();
    jc.parse(args);
    if (options.isDisplayHelp) {
        jc.usage();
        System.exit(0);
    }
    TranslationCLI wrapper = new TranslationCLI();
    wrapper.runWithArgs(options, System.out);
}
Also used : DefaultConsole(com.beust.jcommander.internal.DefaultConsole) JCommander(com.beust.jcommander.JCommander)

Example 2 with DefaultConsole

use of com.beust.jcommander.internal.DefaultConsole in project HarcHardware by bengtmartensson.

the class Wave method usage.

private static void usage(int exitcode) {
    @SuppressWarnings("UseOfSystemOutOrSystemErr") PrintStream printStream = exitcode == IrpUtils.EXIT_SUCCESS ? System.out : System.err;
    argumentParser.setConsole(new DefaultConsole(printStream));
    argumentParser.usage();
    System.exit(exitcode);
}
Also used : PrintStream(java.io.PrintStream) DefaultConsole(com.beust.jcommander.internal.DefaultConsole)

Example 3 with DefaultConsole

use of com.beust.jcommander.internal.DefaultConsole in project HarcHardware by bengtmartensson.

the class LircClient method usage.

private static void usage(int exitcode) {
    @SuppressWarnings("UseOfSystemOutOrSystemErr") PrintStream printStream = exitcode == IrpUtils.EXIT_SUCCESS ? System.out : System.err;
    argumentParser.setConsole(new DefaultConsole(printStream));
    argumentParser.usage();
    // placifying FindBugs...
    doExit(exitcode);
}
Also used : PrintStream(java.io.PrintStream) DefaultConsole(com.beust.jcommander.internal.DefaultConsole)

Example 4 with DefaultConsole

use of com.beust.jcommander.internal.DefaultConsole in project geowave by locationtech.

the class GeoWaveBaseConverter method getConsole.

protected static Console getConsole() {
    if (console == null) {
        try {
            Method consoleMethod = System.class.getDeclaredMethod("console");
            Object systemConsole = consoleMethod.invoke(null);
            if (systemConsole == null) {
                console = new DefaultConsole();
            } else {
                console = new JDK6Console(systemConsole);
            }
        } catch (Throwable t) {
            console = new DefaultConsole();
        }
    }
    return console;
}
Also used : DefaultConsole(com.beust.jcommander.internal.DefaultConsole) Method(java.lang.reflect.Method) JDK6Console(com.beust.jcommander.internal.JDK6Console)

Example 5 with DefaultConsole

use of com.beust.jcommander.internal.DefaultConsole in project IrpTransmogrifier by bengtmartensson.

the class CommandHelp method usage.

public static void usage(PrintStream printStream, String command, JCommander argumentParser) {
    argumentParser.setConsole(new DefaultConsole(printStream));
    if (command == null)
        argumentParser.usage();
    else {
        DefaultUsageFormatter formatter = new DefaultUsageFormatter(argumentParser);
        formatter.usage(command);
    }
}
Also used : DefaultConsole(com.beust.jcommander.internal.DefaultConsole) DefaultUsageFormatter(com.beust.jcommander.DefaultUsageFormatter)

Aggregations

DefaultConsole (com.beust.jcommander.internal.DefaultConsole)9 JCommander (com.beust.jcommander.JCommander)5 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)4 Console (com.beust.jcommander.internal.Console)4 FhirContext (ca.uhn.fhir.context.FhirContext)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 CqlDataProvider (com.ibm.cohort.cql.data.CqlDataProvider)2 R4LibraryDependencyGatherer (com.ibm.cohort.cql.hapi.R4LibraryDependencyGatherer)2 CqlTerminologyProvider (com.ibm.cohort.cql.terminology.CqlTerminologyProvider)2 DefaultRetrieveCacheContext (com.ibm.cohort.engine.measure.cache.DefaultRetrieveCacheContext)2 RetrieveCacheContext (com.ibm.cohort.engine.measure.cache.RetrieveCacheContext)2 R4RestFhirTerminologyProvider (com.ibm.cohort.engine.terminology.R4RestFhirTerminologyProvider)2 FhirClientBuilderFactory (com.ibm.cohort.fhir.client.config.FhirClientBuilderFactory)2 FhirServerConfig (com.ibm.cohort.fhir.client.config.FhirServerConfig)2 PrintStream (java.io.PrintStream)2 IParser (ca.uhn.fhir.parser.IParser)1 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 DefaultUsageFormatter (com.beust.jcommander.DefaultUsageFormatter)1 Parameter (com.beust.jcommander.Parameter)1 JDK6Console (com.beust.jcommander.internal.JDK6Console)1