Package gnu.getopt

Examples of gnu.getopt.LongOpt


   @Override
   public void init(final String[] args) throws Exception {
      // Initialize the context for simple standard I/O
      context = new ContextImpl(new StreamIOAdapter(), new CommandBufferImpl());
      String sopts = "c:f:hv";
      LongOpt[] lopts = new LongOpt[] { new LongOpt("connect", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
            new LongOpt("file", LongOpt.REQUIRED_ARGUMENT, null, 'f'),
            new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
            new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v'), };
      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
View Full Code Here


        boolean quiet = false, showVersion = false, showHelp = false;
        File configFile = null;

        // Long options are available but are not advertised.
        LongOpt[] longOptions = {
                new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
                new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
                new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v')};

        Getopt g = new Getopt(Ripple.getName(), args, "hqv", longOptions);
        int c;
        while ((c = g.getopt()) != -1) {
            switch (c) {
View Full Code Here

/*     */   }
/*     */
/*     */   private URL parseArguments(String[] args)
/*     */   {
/*  84 */     String shortOpts = "b:c:p:w:o:s:t:khqvl";
/*  85 */     LongOpt[] longOpts = { new LongOpt("binding", 1, null, 98), new LongOpt("catalog", 1, null, 99), new LongOpt("package", 1, null, 112), new LongOpt("wsdlLocation", 1, null, 119), new LongOpt("output", 1, null, 111), new LongOpt("source", 1, null, 115), new LongOpt("target", 1, null, 116), new LongOpt("keep", 0, null, 107), new LongOpt("help", 0, null, 104), new LongOpt("quiet", 0, null, 113), new LongOpt("verbose", 0, null, 118), new LongOpt("load-consumer", 0, null, 108) };
/*     */
/* 101 */     Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
/*     */     int c;
/* 103 */     while ((c = getopt.getopt()) != -1)
/*     */     {
View Full Code Here

/*     */   }
/*     */
/*     */   private String parseArguments(String[] args)
/*     */   {
/*  82 */     String shortOpts = "hwko:r:s:c:qtl";
/*  83 */     LongOpt[] longOpts = { new LongOpt("help", 0, null, 104), new LongOpt("wsdl", 0, null, 119), new LongOpt("keep", 0, null, 107), new LongOpt("output", 1, null, 111), new LongOpt("resource", 1, null, 114), new LongOpt("source", 1, null, 115), new LongOpt("classpath", 1, null, 99), new LongOpt("quiet", 0, null, 113), new LongOpt("show-traces", 0, null, 116), new LongOpt("load-provider", 0, null, 108) };
/*     */
/*  97 */     Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
/*     */     int c;
/*  99 */     while ((c = getopt.getopt()) != -1)
/*     */     {
View Full Code Here

/*     */   private void processCommandLine(String[] args)
/*     */     throws Exception
/*     */   {
/* 257 */     String programName = System.getProperty("program.name", "jboss");
/* 258 */     String sopts = "-:hD:d:p:n:c:Vj::B:L:C:P:b:g:u:m:l:";
/* 259 */     LongOpt[] lopts = { new LongOpt("help", 0, null, 104), new LongOpt("bootdir", 1, null, 100), new LongOpt("patchdir", 1, null, 112), new LongOpt("netboot", 1, null, 110), new LongOpt("configuration", 1, null, 99), new LongOpt("version", 0, null, 86), new LongOpt("jaxp", 1, null, 106), new LongOpt("bootlib", 1, null, 66), new LongOpt("library", 1, null, 76), new LongOpt("classpath", 1, null, 67), new LongOpt("properties", 1, null, 80), new LongOpt("host", 1, null, 98), new LongOpt("partition", 1, null, 103), new LongOpt("udp", 1, null, 117), new LongOpt("mcast_port", 1, null, 109), new LongOpt("log", 1, null, 108) };
/*     */
/* 279 */     Getopt getopt = new Getopt(programName, args, sopts, lopts);
/*     */
/* 282 */     this.props.setProperty("jboss.bind.address", "127.0.0.1");
/* 283 */     System.setProperty("jboss.bind.address", "127.0.0.1");
View Full Code Here

   @Override
   public void init(final String[] args) throws Exception {
      // Initialize the context for simple standard I/O
      context = new ContextImpl(new StreamIOAdapter(), new CommandBufferImpl());
      String sopts = "c:f:hv";
      LongOpt[] lopts = new LongOpt[] { new LongOpt("connect", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
            new LongOpt("file", LongOpt.REQUIRED_ARGUMENT, null, 'f'),
            new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
            new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v'), };
      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
View Full Code Here

   @Override
   public void init(final String[] args) throws Exception {
      // Initialize the context for simple standard I/O
      context = new ContextImpl(new StreamIOAdapter(), new CommandBufferImpl());
      String sopts = "c:f:hv";
      LongOpt[] lopts = new LongOpt[] { new LongOpt("connect", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
            new LongOpt("file", LongOpt.REQUIRED_ARGUMENT, null, 'f'),
            new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
            new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v'), };
      Getopt g = new Getopt("ispn-cli", args, sopts, lopts);
      int c;
      while ((c = g.getopt()) != -1) {
         switch (c) {
         case 'c':
View Full Code Here

    private static Map<Option, Collection<String>> buildCommandLineArgumentMap(String[] args) {

        List<LongOpt> los = new ArrayList<>();
        for (Option o : Option.values()) {
            los.add(new LongOpt(o.getName(), o.requiresArgument() ? LongOpt.REQUIRED_ARGUMENT : LongOpt.NO_ARGUMENT, null, 0));
        }

        Getopt g = new Getopt("JOSM", args, "hv", los.toArray(new LongOpt[los.size()]));

        Map<Option, Collection<String>> argMap = new HashMap<>();
View Full Code Here

   private URL parseArguments(String[] args)
   {
      String shortOpts = "b:c:p:w:o:s:t:khqvl";
      LongOpt[] longOpts =
      {
         new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
         new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
         new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
         new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
         new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
         new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
         new LongOpt("target", LongOpt.REQUIRED_ARGUMENT, null, 't'),
         new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
         new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
         new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
         new LongOpt("verbose", LongOpt.NO_ARGUMENT, null, 'v'),
         new LongOpt("load-consumer", LongOpt.NO_ARGUMENT, null, 'l'),
      };

      Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
      int c;
      while ((c = getopt.getopt()) != -1)
View Full Code Here

TOP

Related Classes of gnu.getopt.LongOpt

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.