A Question Asker
A Question Asker

Reputation: 3343

Is it possible to have a final, unnamed argument with Apache CLI?

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

Answers (1)

Uwe Plonus
Uwe Plonus

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

Related Questions