commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Liu <lyz10302...@gmail.com>
Subject Re: Commons CLI command stype
Date Tue, 29 Jan 2013 15:20:45 GMT
*Thanks *Thomas

2013/1/28 Thomas Neidhart <thomas.neidhart@gmail.com>

> On 01/28/2013 06:08 PM, Eric Liu wrote:
> > Hi,
> >
> >  I know the default 'Commons CLI'  command style is like ' java -jar
> > ***.jar [OPTIONS]'. Can anyone tell me how to make this kind of command
> > style using Commons CLI?
> >
> >  java -jar ***.jar  [COMMAND] [OPTIONS]
>
> Well, as you already pointed out, Commons CLI currently only supports
> additional (or left-over) arguments at the end like this:
>
> java -jar ***.jar [OPTIONS] [COMMAND]
>
> But if you know for sure that the first token will be the command, you
> could strip the first argument (after making sure it is not an option),
> and only provide the remaining arguments to the parser.
>
> The help text could be manually adjusted like that:
>
>   formatter.printHelp("myapp [COMMAND]", header, options, footer, true);
>
> You could also create a feature request in JIRA if you like.
>
> Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message