[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Handling short and long options
From: |
angioberlinguer |
Subject: |
Handling short and long options |
Date: |
Tue, 07 Sep 2021 03:58:02 +0000 |
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, September 7, 2021 3:53 AM, Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>
wrote:
> yea do so, good luck
* Do you have a strategy on how to handle multiple values for an option? Would
be
eager to read through.
> On Tue, Sep 7, 2021, 05:36 angioberlinguer angioberlinguer@protonmail.com
> wrote:
>
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> > On Tuesday, September 7, 2021 3:14 AM, Alex fxmbsw7 Ratchev <
> > fxmbsw7@gmail.com> wrote:
> > well imho such is weak
> > at a standart minimum, a -o or --opt with a one required argument, needs
> > still to be parsed both ways
> > i mean with space for next arg or a = for inside_this_arg
> > .. not just the --opt variant
> > the code to support this could be simple
> > but i discourage the use of mixed args ( eg with an equal sign instead of
> > on its own )
> >
> > - Ok, Alex, I will focus on supporting both.
> >
> > codewise, per !i in args, parse off the part before = whenever exisiting,
> > and check then if its a supported arg, then check whenever that arg needs
> > required number of args, then parse em, the first guess being the part
> > after =, in case
> > like without = an arg can have 3 args, no =, -o 1 2 3 otheropt, --opt 1 2
> > 3 otheropt
> >
> > - This is interesting, not thought about having multiple args yet.
> >
> > Will spend some more time on it, and send over my solution, and discuss
> > how to enhance its capability.
> > On Tue, Sep 7, 2021, 04:55 angioberlinguer angioberlinguer@protonmail.com
> > wrote:
> >
> > > Hi Alex , thanks fuck for that! It's not a total disaster then. Have
> > > found some useful discussions
> > > in the following stackoverflow question. They handle short-options with
> > > spaces and long-options with
> > > equal signs.
> > > https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash/29754866#29754866
- Handling short and long options, angioberlinguer, 2021/09/06
- Re: Handling short and long options, Dennis Williamson, 2021/09/06
- Handling short and long options, angioberlinguer, 2021/09/06
- Re: Handling short and long options, Alex fxmbsw7 Ratchev, 2021/09/06
- Handling short and long options, angioberlinguer, 2021/09/06
- Re: Handling short and long options, Alex fxmbsw7 Ratchev, 2021/09/06
- Handling short and long options, angioberlinguer, 2021/09/06
- Re: Handling short and long options, Alex fxmbsw7 Ratchev, 2021/09/06
- Handling short and long options,
angioberlinguer <=
- Re: Handling short and long options, Alex fxmbsw7 Ratchev, 2021/09/07
- Re: Handling short and long options, Alex fxmbsw7 Ratchev, 2021/09/07
- Re: Handling short and long options, Alex fxmbsw7 Ratchev, 2021/09/07
Re: Handling short and long options, Lawrence Velázquez, 2021/09/06
Re: Handling short and long options, Greg Wooledge, 2021/09/06