I'm coding a tool in java that need some input passed by args[] I know how to use argument but i wish to handle better this input.
this is a part of my code:
if (args.length > 0 ) {
switch (args[0]) {
case "scan": blah blah
break;
case "some cases": some code
break;
but of course args are strictly bounded to their position, in fact in the command line i have to call:
java javaProgram arg1 arg2 arg3
i really don't like this...
What i want is to better manage this arguments with options like any other c programmed tool, indipendent from positions:
example:
java javaProgram -ip 127.0.0.1 -database data.txt -vv -out output.txt
any help will be appreciated!
Dave
(i'm thinking about an array list of arguments, can be a solution?)