[CLI] Option arguments without - or --

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[CLI] Option arguments without - or --

Amey Jadiye
Hi,

I'm developing a console application and required to get the command and
argument in non traditional fashion where command name dont start with
-name=value or --name=value.

I expect the cli library should handle in below fashion

Push 1 2 3 4
Pull 5 8 9

Where push and Pull is command proceed with their arguments.

I searched the library but didn't found such option, does anyone know how
to achieve this with Apache Commons CLI ?

If this functionality is not present I can contribute in couple of weeks.

Regards,
Amey
Reply | Threaded
Open this post in threaded view
|

Re: [CLI] Option arguments without - or --

Amey Jadiye
Hi,

Looks like the functionality is not present in the code base.

I'm proposing the SimpleCommandParser which can implement CommandLineParser
for achieving below requirements. let me know your thoughts on this.

Regards,
Amey

On Wed, Mar 27, 2019 at 11:32 AM Amey Jadiye <[hidden email]> wrote:

> Hi,
>
> I'm developing a console application and required to get the command and
> argument in non traditional fashion where command name dont start with
> -name=value or --name=value.
>
> I expect the cli library should handle in below fashion
>
> Push 1 2 3 4
> Pull 5 8 9
>
> Where push and Pull is command proceed with their arguments.
>
> I searched the library but didn't found such option, does anyone know how
> to achieve this with Apache Commons CLI ?
>
> If this functionality is not present I can contribute in couple of weeks.
>
> Regards,
> Amey
>
>

--

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [CLI] Option arguments without - or --

sebb-2-2
On Fri, 29 Mar 2019 at 07:04, Amey Jadiye <[hidden email]> wrote:
>
> Hi,
>
> Looks like the functionality is not present in the code base.
>
> I'm proposing the SimpleCommandParser which can implement CommandLineParser
> for achieving below requirements. let me know your thoughts on this.

Thanks for the suggestion.

However, unless I have misunderstood the requirement, parsing looks to
be trivial and not worth the additional effort of creating and
maintaining library code.

It also seems to be a very uncommon use case, so I doubt that many
people would use the code.

> Regards,
> Amey
>
> On Wed, Mar 27, 2019 at 11:32 AM Amey Jadiye <[hidden email]> wrote:
>
> > Hi,
> >
> > I'm developing a console application and required to get the command and
> > argument in non traditional fashion where command name dont start with
> > -name=value or --name=value.
> >
> > I expect the cli library should handle in below fashion
> >
> > Push 1 2 3 4
> > Pull 5 8 9
> >
> > Where push and Pull is command proceed with their arguments.
> >
> > I searched the library but didn't found such option, does anyone know how
> > to achieve this with Apache Commons CLI ?
> >
> > If this functionality is not present I can contribute in couple of weeks.
> >
> > Regards,
> > Amey
> >
> >
>
> --
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: [hidden email]
>
> For additional commands, e-mail: [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [CLI] Option arguments without - or --

Amey Jadiye
On Fri, Mar 29, 2019 at 3:41 PM sebb <[hidden email]> wrote:

> On Fri, 29 Mar 2019 at 07:04, Amey Jadiye <[hidden email]> wrote:
> >
> > Hi,
> >
> > Looks like the functionality is not present in the code base.
> >
> > I'm proposing the SimpleCommandParser which can implement
> CommandLineParser
> > for achieving below requirements. let me know your thoughts on this.
>
> Thanks for the suggestion.
>
> However, unless I have misunderstood the requirement, parsing looks to
> be trivial and not worth the additional effort of creating and
> maintaining library code.
>
well, In that case existing code should be made flexible enough to meet the
requirement.
I'll think about the changes and raise PR.

>
> It also seems to be a very uncommon use case, so I doubt that many
> people would use the code.
>
> > Regards,
> > Amey
> >
> > On Wed, Mar 27, 2019 at 11:32 AM Amey Jadiye <[hidden email]>
> wrote:
> >
> > > Hi,
> > >
> > > I'm developing a console application and required to get the command
> and
> > > argument in non traditional fashion where command name dont start with
> > > -name=value or --name=value.
> > >
> > > I expect the cli library should handle in below fashion
> > >
> > > Push 1 2 3 4
> > > Pull 5 8 9
> > >
> > > Where push and Pull is command proceed with their arguments.
> > >
> > > I searched the library but didn't found such option, does anyone know
> how
> > > to achieve this with Apache Commons CLI ?
> > >
> > > If this functionality is not present I can contribute in couple of
> weeks.
> > >
> > > Regards,
> > > Amey
> > >
> > >
> >
> > --
> >
> > ---------------------------------------------------------------------
> >
> > To unsubscribe, e-mail: [hidden email]
> >
> > For additional commands, e-mail: [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]