Package gnu.getopt

Examples of gnu.getopt.LongOpt


  private static String idHash = null;

  public static void main(String[] args) {
    int argp = 0;
    LongOpt[] opts = {
      new LongOpt("mime-type", LongOpt.REQUIRED_ARGUMENT, null, 't'),
      new LongOpt("method", LongOpt.REQUIRED_ARGUMENT, null, 'm'),
      new LongOpt("properties", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
      new LongOpt("encoding", LongOpt.REQUIRED_ARGUMENT, null, 'e'),
      new LongOpt("directory", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
      new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
      new LongOpt("indent", LongOpt.REQUIRED_ARGUMENT, null, 'i'),
      new LongOpt("define", LongOpt.REQUIRED_ARGUMENT, null, 'd'),
      new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v'),
      new LongOpt("resolve-entities", LongOpt.NO_ARGUMENT, null,'r'),
      new LongOpt("suppress-comments", LongOpt.NO_ARGUMENT, null,'C'),
      new LongOpt("transform", LongOpt.REQUIRED_ARGUMENT, null,'x'),
      new LongOpt("skip-validation", LongOpt.NO_ARGUMENT, null, 'V'),
      new LongOpt("no-media-type", LongOpt.NO_ARGUMENT, null, 'T'),
      new LongOpt("library", LongOpt.REQUIRED_ARGUMENT, null, 'L'),
      new LongOpt("hash", LongOpt.REQUIRED_ARGUMENT, null, 'H'),
      new LongOpt("autohash", LongOpt.NO_ARGUMENT, null, 'a')
    };
   
    Getopt go = new Getopt("dexter", args,
        "m::L::o::p::e::i::t::d::x::H::hvrCVT", opts, false);
    int s;
View Full Code Here


  private static String idHash = null;

  public static void main(String[] args) {
    int argp = 0;
    LongOpt[] opts = new LongOpt[16];
    opts[0] = new LongOpt("mime-type", LongOpt.REQUIRED_ARGUMENT, null, 't');
    opts[1] = new LongOpt("method", LongOpt.REQUIRED_ARGUMENT, null, 'm');
    opts[2] = new LongOpt("properties", LongOpt.REQUIRED_ARGUMENT, null,
        'p');
    opts[3] = new LongOpt("encoding", LongOpt.REQUIRED_ARGUMENT, null, 'e');
    opts[4] = new LongOpt("directory", LongOpt.REQUIRED_ARGUMENT, null, 'o');
    opts[5] = new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h');
    opts[6] = new LongOpt("indent", LongOpt.REQUIRED_ARGUMENT, null, 'i');
    opts[7] = new LongOpt("define", LongOpt.REQUIRED_ARGUMENT, null, 'd');
    opts[8] = new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v');
    opts[9] = new LongOpt("resolve-entities", LongOpt.NO_ARGUMENT, null,
        'r');
    opts[10] = new LongOpt("suppress-comments", LongOpt.NO_ARGUMENT, null,
        'C');
    opts[11] = new LongOpt("transform", LongOpt.REQUIRED_ARGUMENT, null,
        'x');
    opts[12] = new LongOpt("skip-validation", LongOpt.NO_ARGUMENT, null,
        'V');
    opts[13] = new LongOpt("no-media-type", LongOpt.NO_ARGUMENT, null, 'T');
    opts[14] = new LongOpt("library", LongOpt.REQUIRED_ARGUMENT, null, 'L');
    opts[15] = new LongOpt("hash", LongOpt.REQUIRED_ARGUMENT, null, 'H');

    Getopt go = new Getopt("dexter", args,
        "m::L::o::p::e::i::t::d::x::H::hvrCVT", opts, false);
    int s;
View Full Code Here

int c;
String arg;
LongOpt[] longopts = new LongOpt[3];
//
StringBuffer sb = new StringBuffer();
longopts[0] = new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h');
longopts[1] = new LongOpt("outputdir", LongOpt.REQUIRED_ARGUMENT, sb, 'o');
longopts[2] = new LongOpt("maximum", LongOpt.OPTIONAL_ARGUMENT, null, 2);
//
Getopt g = new Getopt("testprog", argv, "-:bc::d:hW;", longopts);
g.setOpterr(false); // We'll do our own error handling
//
while ((c = g.getopt()) != -1)
View Full Code Here

   private URL parseArguments(String[] args)
   {
    String shortOpts = "b:c:p:w:o:s:t:khqvlne";
      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("nocompile", LongOpt.NO_ARGUMENT, null, 'n'),
         new LongOpt("extension", LongOpt.NO_ARGUMENT, null, 'e'),
         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

  }

    @Override
    protected LongOpt[] getCommandOptions()
    {
        LongOpt recursiveLongOpt = new LongOpt("recursive", LongOpt.NO_ARGUMENT, null, 'R');
        return new LongOpt[]{recursiveLongOpt};
    }
View Full Code Here

    }
   
    @Override
    protected LongOpt[ ] getCommandOptions( )
    {
  LongOpt quite = new LongOpt( "quite", LongOpt.NO_ARGUMENT, null, 'q' );
  LongOpt verbose = new LongOpt( "verbose", LongOpt.NO_ARGUMENT, null,
    'v' );
  LongOpt storeConfigFile = new LongOpt( Main.STORE_CONFIG_FILE,
    LongOpt.REQUIRED_ARGUMENT, null,
    'c' );
  LongOpt loggingConfigFile = new LongOpt( Main.LOG_CONFIG_FILE,
    LongOpt.REQUIRED_ARGUMENT, null, 'l' );
  return new LongOpt[ ]
  { quite, verbose, storeConfigFile, loggingConfigFile };
    }
View Full Code Here

            int option;

            while ( ( option = getopt.getopt(  ) ) != -1 )
            {
                LongOpt longOpt = longOptMap.get( ( char ) option );

                if ( longOpt.getHasArg(  ) != 0 )
                {
                    String optionArg = getopt.getOptarg(  );
                    _argumentOptions.put( longOpt.getName(  ), optionArg );
                }
                else
                {
                    _argumentOptions.put( longOpt.getName(  ), "true" );
                }
            }
            args = Arrays.copyOfRange(args, getopt.getOptind(), args.length);
        }
View Full Code Here

  }

    @Override
    protected LongOpt[] getCommandOptions()
    {
        LongOpt recursiveLongOpt = new LongOpt("recursive", LongOpt.NO_ARGUMENT, null, 'r');
        return new LongOpt[]{recursiveLongOpt};
    }
View Full Code Here

   private URL parseArguments(String[] args)
   {
      String shortOpts = "b:c:p:w:o:s:t:khqvle";
      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("extension", LongOpt.NO_ARGUMENT, null, 'e'),
         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

    }

    StringBuffer valueBuffer=new StringBuffer();

    LongOpt[] longOpts={
      new LongOpt("debug", LongOpt.NO_ARGUMENT, null, 'd'),
      new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
      new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'v')
    };

    Getopt g=new Getopt("Brainfuck", args, "dhv", longOpts);
    g.setOpterr(false);
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.