I am working on a java swing application which currently allows a user to import one or more files to be processed.
This is done right now by executing the jar using
java -jar [jarname] [filename 1] [filename 2] ... [filename N]
.
I am tasked with to change the behaviour so as to keep it working in this current mode and add another mode of execution by adding an option parameter:
java -jar [jarname] [filename 1] -o [option]
.
In the second mode, I need to make sure that the arguments contain a single filename argument with a single option flag followed by a single option argument. The option will be used to process the file. Alternatively, if the jar is executed in the first mode using only one file, there is a menu option in the application that the user should be able to use to process the file with the required option.
I am looking for ideas/tips to accomplish this.
Thanks in advance.