What if I wanted to parse this:
java MyProgram -r opt1 -S opt2 arg1 arg2 arg3 arg4 --test -A opt3
And the result I want in my program is:>
Simple code for command line in java:
class CMDLineArgument { public static void main(String args[]) { String name=args[0]; System.out.println(name); } }