Reputation: 3343
I want to be able to have arguments in the following form:
./mything -arg1 hey -arg2 ho filename
So an optional arg1, an optional arg2, and then an unnamed last argument. I was wondering if there is a way to do this with Apache CLI? I can just grab it from the argument to main, but that seems janky.
Appreciate any help.
Upvotes: 5
Views: 1010
Reputation: 9974
Apache CLI has a method getArgList()
which returns all not handled options and arguments from the command line. This will do the job.
Upvotes: 8