Package org.kohsuke.args4j

Examples of org.kohsuke.args4j.CmdLineParser.printExample()


            cmdLineParser.printUsage(System.err);
            System.err.println();

            // print option sample. This is useful some time
            System.err.println("  Example: ./mockserver"
                    + cmdLineParser.printExample(ExampleMode.ALL));

            return -1;
        }

        // infer format from filename
View Full Code Here


      StringWriter writer = new StringWriter();
      parser.printUsage(writer, null);
      msg.append(writer.getBuffer());
      msg.append("\n");
      // print option sample. This is useful some time
      msg.append("  Example: java -jar properties-compiler.jar").append(parser.printExample(REQUIRED));
      msg.append("\n");
      System.err.println(msg); // NOSONAR this is a commandline tool
      return -1;
    }
View Full Code Here

            // print the list of available options
            parser.printUsage(System.err);
            System.err.println();

            // print option sample. This is useful some time
            System.err.println("  Example: java SampleMain"+parser.printExample(ALL));

            return;
        }

        // this will redirect the output to the specified output
View Full Code Here

            System.err.println("s3mper fs verify [options]");
            // print the list of available options
            parser.printUsage(System.err);
            System.err.println();

            System.err.println(" Example: s3mper fs verify "+parser.printExample(OptionHandlerFilter.ALL));
        }
    }
   
    private class FileCheckTask implements Callable<Boolean> {
        private Path path;
View Full Code Here

            System.err.println("java SampleMain [options...] arguments...");
            // print the list of available options
            parser.printUsage(System.err);
            System.err.println();

            System.err.println(" Example: s3mper metastore "+parser.printExample(OptionHandlerFilter.ALL));

            return;
        }
       
        MetastoreJanitor janitor = new MetastoreJanitor();
View Full Code Here

            System.err.println("s3mper meta delete_ts [options]");
            // print the list of available options
            parser.printUsage(System.err);
            System.err.println();

            System.err.println(" Example: s3mper meta delete_ts "+parser.printExample(OptionHandlerFilter.ALL));

            return;
        }
       
        MetastoreJanitor janitor = new MetastoreJanitor();
View Full Code Here

        } catch (AbortException e) {
            System.err.println(e.getMessage());
            return 1;
        } catch (CmdLineException e) {
            System.err.println(e.getMessage());
            System.err.println("Usage: bees "+args.get(0)+" "+p.printExample(ExampleMode.REQUIRED));
            p.printUsage(System.err);
            return 1;
        }
    }
View Full Code Here

    public void printHelp(List<String> args) {
        CmdLineParser p = createParser();
        if (getUsageMessage() != null)
            System.err.println("Usage: bees "+args.get(0)+" "+getUsageMessage());
        else {
            System.err.print("Usage: bees "+args.get(0)+p.printExample(ExampleMode.REQUIRED));
            for (OptionHandler optionHandler: p.getArguments()) {
                if (optionHandler.option.required())
                    System.err.print(" " + optionHandler.getMetaVariable(null));
                else
                    System.err.print(" [" + optionHandler.getMetaVariable(null) + "]");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.