Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gui client command line arguments

 
Marcos Motta
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My assignment only allows me to use command line parameters from this list:
-DNS name of the server
-Port number used by the server
-Data file name(s)
-java.rmi.server.codebase
-security manager policy file
To start my client in local mode it uses only one parameter, he data file name.
To start in remote mode I also only need one parameter, the host where the server has been started. It makes no sense to pass the path of the database file from the client to the server. When the server was started it was told where the file is and the clients will be accessing this file indirectly.
My problem is: For both modes, local and remote, I only need one parameter. I am not allowed to introduce a new parameter such as "-remote", wich would help to determine whether the other string parameter is the host or file name.
How can I distinguish the local mode from the remote mode in the command line???
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"-DNS name of the server
-Port number used by the server
-Data file name(s)"
these three -<<type>> seperate what each is. for instance
java -Data c:\mydatafile\db.db -jar client.jar
or
java -DNS myserver.com -jar client.jar.

I think that is correct.
Hope that helps
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic