@ 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 ( ) ) ; }
Initialize the arg parser for the Transform sub command