Package net.sourceforge.argparse4j.inf

Examples of net.sourceforge.argparse4j.inf.Subparser


     *
     * @param subparsers The Subparsers object to attach the new Subparser to
     */
    @Override
    public void intializeSubCommand( Subparsers subparsers ) {
        Subparser diffyParser = subparsers.addParser( "diffy" )
                .description( "Jolt CLI Diffy Tool. This tool will ingest two JSON inputs (from files or standard input) and " +
                        "perform the Jolt Diffy operation to detect any differences. The program will return an exit code of " +
                        "0 if no differences are found or a 1 if a difference is found or an error is encountered." )
                .defaultHelp( true );

        diffyParser.addArgument( "filePath1" ).help( "File path to feed to Input #1 for the Diffy operation. " +
                "This file should contain valid JSON." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() );
        diffyParser.addArgument( "filePath2" ).help( "File path to feed to Input #2 for the Diffy operation. " +
                "This file should contain valid JSON. " +
                "This argument is mutually exclusive with -i; one or the other should be specified." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() )
                .nargs( "?" ).setDefault( (File) null );   // these last two method calls make filePath2 optional

        diffyParser.addArgument( "-s" ).help( "Diffy will suppress output and run silently." )
                .action( Arguments.storeTrue() );
        diffyParser.addArgument( "-a" ).help( "Diffy will not consider array order when detecting differences" )
                .action( Arguments.storeTrue() );
    }
View Full Code Here


     *
     * @param subparsers The Subparsers object to attach the new Subparser to
     */
    @Override
    public void intializeSubCommand( Subparsers subparsers ) {
        Subparser transformParser = subparsers.addParser( "transform" )
                .description( "Jolt CLI Transform Tool. This tool will ingest a JSON spec file and an JSON input (from a file or " +
                        "standard input) and run the transforms specified in the spec file on the input. The program will return an " +
                        "exit code of 0 if the input is transformed successfully or a 1 if an error is encountered" )
                .defaultHelp( true );

        File nullFile = null;
        transformParser.addArgument( "spec" ).help( "File path to Jolt Transform Spec to execute on the input. " +
                "This file should contain valid JSON." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() );
        transformParser.addArgument( "input" ).help( "File path to the input JSON for the Jolt Transform operation. " +
                "This file should contain valid JSON. " +
                "If this argument is not specified then standard input will be used." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() )
                .nargs( "?" ).setDefault( nullFile );   // these last two method calls make input optional

        transformParser.addArgument( "-u" ).help( "Turns off pretty print for the output. Output will be raw json with no formatting." )
                .action( Arguments.storeTrue() );
    }
View Full Code Here

     *
     * @param subparsers The Subparsers object to attach the new Subparser to
     */
    @Override
    public void intializeSubCommand( Subparsers subparsers ) {
        Subparser diffyParser = subparsers.addParser( "diffy" )
                .description( "Jolt CLI Diffy Tool. This tool will ingest two JSON inputs (from files or standard input) and " +
                        "perform the Jolt Diffy operation to detect any differences. The program will return an exit code of " +
                        "0 if no differences are found or a 1 if a difference is found or an error is encountered." )
                .defaultHelp( true );

        diffyParser.addArgument( "filePath1" ).help( "File path to feed to Input #1 for the Diffy operation. " +
                "This file should contain valid JSON." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() );
        diffyParser.addArgument( "filePath2" ).help( "File path to feed to Input #2 for the Diffy operation. " +
                "This file should contain valid JSON. " +
                "If this argument is not specified then standard input will be used." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() )
                .nargs( "?" ).setDefault( (File) null );   // these last two method calls make filePath2 optional

        diffyParser.addArgument( "-s" ).help( "Diffy will suppress output and run silently." )
                .action( Arguments.storeTrue() );
        diffyParser.addArgument( "-a" ).help( "Diffy will not consider array order when detecting differences" )
                .action( Arguments.storeTrue() );
    }
View Full Code Here

    }

    @Override
    public void configure(Subparser subparser) {
        for (AbstractLiquibaseCommand<T> subcommand : subcommands.values()) {
            final Subparser cmdParser = subparser.addSubparsers()
                                                 .addParser(subcommand.getName())
                                                 .setDefault(COMMAND_NAME_ATTR, subcommand.getName())
                                                 .description(subcommand.getDescription());
            subcommand.configure(cmdParser);
        }
View Full Code Here

     *
     * @param subparsers The Subparsers object to attach the new Subparser to
     */
    @Override
    public void intializeSubCommand( Subparsers subparsers ) {
        Subparser transformParser = subparsers.addParser( "transform" )
                .description( "Jolt CLI Transform Tool. This tool will ingest a JSON spec file and an JSON input (from a file or " +
                        "standard input) and run the transforms specified in the spec file on the input. The program will return an " +
                        "exit code of 0 if the input is transformed successfully or a 1 if an error is encountered" )
                .defaultHelp( true );

        File nullFile = null;
        transformParser.addArgument( "spec" ).help( "File path to Jolt Transform Spec to execute on the input. " +
                "This file should contain valid JSON." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() );
        transformParser.addArgument( "input" ).help( "File path to the input JSON for the Jolt Transform operation. " +
                "This file should contain valid JSON. " +
                "If this argument is not specified then standard input will be used." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() )
                .nargs( "?" ).setDefault( nullFile );   // these last two method calls make input optional

        transformParser.addArgument( "-u" ).help( "Turns off pretty print for the output. Output will be raw json with no formatting." )
                .action( Arguments.storeTrue() );
    }
View Full Code Here

     *
     * @param subparsers The Subparsers object to attach the new Subparser to
     */
    @Override
    public void intializeSubCommand( Subparsers subparsers ) {
        Subparser sortParser = subparsers.addParser( "sort" )
                .description( "Jolt CLI Sort Tool. This tool will ingest one JSON input (from a file or standard input) and " +
                        "perform the Jolt sort operation on it. The sort order is standard alphabetical ascending, with a " +
                        "special case for \"~\" prefixed keys to be bumped to the top. The program will return an exit code " +
                        "of 0 if the sort operation is performed successfully or a 1 if an error is encountered." )
                .defaultHelp( true );

        sortParser.addArgument( "input" ).help( "File path to the input JSON that the sort operation should be performed on. " +
                "This file should contain valid JSON. " +
                "If this argument is not specified then standard input will be used." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() )
                .nargs( "?" ).setDefault( (File) null ).required( false );   // these last two method calls make input optional

        sortParser.addArgument( "-u" ).help( "Turns off pretty print for the output. Output will be raw json with no formatting." )
                .action( Arguments.storeTrue() );
    }
View Full Code Here

     *
     * @param subparsers The Subparsers object to attach the new Subparser to
     */
    @Override
    public void intializeSubCommand( Subparsers subparsers ) {
        Subparser diffyParser = subparsers.addParser( "diffy" )
                .description( "Jolt CLI Diffy Tool. This tool will ingest two JSON inputs (from files or standard input) and " +
                        "perform the Jolt Diffy operation to detect any differences. The program will return an exit code of " +
                        "0 if no differences are found or a 1 if a difference is found or an error is encountered." )
                .defaultHelp( true );

        diffyParser.addArgument( "filePath1" ).help( "File path to feed to Input #1 for the Diffy operation. " +
                "This file should contain valid JSON." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() );
        diffyParser.addArgument( "filePath2" ).help( "File path to feed to Input #2 for the Diffy operation. " +
                "This file should contain valid JSON. " +
                "If this argument is not specified then standard input will be used." )
                .type( Arguments.fileType().verifyExists().verifyIsFile().verifyCanRead() )
                .nargs( "?" ).setDefault( (File) null );   // these last two method calls make filePath2 optional

        diffyParser.addArgument( "-s" ).help( "Diffy will suppress output and run silently." )
                .action( Arguments.storeTrue() );
        diffyParser.addArgument( "-a" ).help( "Diffy will not consider array order when detecting differences" )
                .action( Arguments.storeTrue() );
    }
View Full Code Here

    // Master Commands
    new MasterListCommand(p("masters"));

    // Version Command
    final Subparser version = p("version").help("print version of master and client");
    new VersionCommand(version);
  }
View Full Code Here

  private Subparser p(final String name) {
    return p(commandParsers, name);
  }

  private Subparser p(final Subparsers subparsers, final String name) {
    final Subparser subparser = subparsers.addParser(name, true);
    addGlobalArgs(subparser, cliConfig);
    return subparser;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.argparse4j.inf.Subparser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.