Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 959242

Pages: 1
javanic
stranger


Reged: 10/12/06
Posts: 1
usage tips.
      #39080 - 10/13/06 12:01 PM

I have a simple command line option set. However, I have not been able to set them up to work. Any help or tips would be appreciated. Here is what my argument options are:

myApp -s -f filename.xml
myApp -g [-f filename.xml]

The -s is for silent operation (no gui) and requires -f with a filename at the end
the -g is for gui operation and it is optional to attach an xml file.

How should I set this up?

Here is my latest contortion to get it to work. None of them have been successful.

myOptions = new ml.options.Options(args, 0, 1);
myOptions.addSet("silent", 0).addOption("s", Multiplicity.ZERO_OR_ONE);
myOptions.getSet("silent").addOption("f", false, Separator.BLANK, Multiplicity.ZERO_OR_ONE );
myOptions.addSet("gui", 0).addOption("g", Multiplicity.ZERO_OR_ONE);
myOptions.getSet("gui").addOption("f", Multiplicity.ZERO_OR_ONE);
OptionSet set = myOptions.getMatchingSet(true, true);

If you have any experience with this tool, please lend me a hand.

Thanks,

Brian


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 4635

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5