• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Mode Flag When Running Program

 
Jason Mowat
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,
When running the executable jar and specifying the mode flag of "server" or "alone", are the quotes included as one of the "musts"?
For example, which is the acceptable version:
java -jar c:\runme.jar "alone"
-or-
java -jar c:\runme.jar alone
My assumption is the latter (without quotes), but I want to be 100% sure. The specification illustrates the mode flag with quotes.
The program will run either way (i.e. with our without the quotes), but I'm wondering if I need to be paranoid enough so that it rejects alone if it was expecting "alone". I'm shaking my head at this possibility, but now I'm a little gun-shy of my submission and want everything spelled out, just to be sure.
Cheers,
Jason
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason,
Originally posted by Jason Mowat:
java -jar c:\runme.jar alone

This is the correct one (without quotes). I think you can safely reject any command-line arguments other than the following: alone, server. If you detect some other command-line argument, I would suggest you respond with something like the following before terminating the program:

Hope this helps,
George
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic