Handling options with optional arguments with getopts

2021-08-28 Thread hancooper
‐‐‐ Original Message ‐‐‐ On Saturday, August 28, 2021 4:49 PM, Robert Elz wrote: > Date:Sat, 28 Aug 2021 15:26:28 + > From:hancooper > > Message-ID: > > > > | Would the code break if I use shortopts="Vuhv:s" (allows getopts > | to issue errors, not in

Re: Handling options with optional arguments with getopts

2021-08-28 Thread Robert Elz
Date:Sat, 28 Aug 2021 15:26:28 + From:hancooper Message-ID: | Would the code break if I use shortopts="Vuhv:s" (allows getopts | to issue errors, not in silent mode) but also have the (":") and | ("?") checks inside the case statement? Not break, but

Handling options with optional arguments with getopts

2021-08-28 Thread hancooper
‐‐‐ Original Message ‐‐‐ On Friday, August 27, 2021 8:52 PM, Robert Elz wrote: > Date:Fri, 27 Aug 2021 17:20:39 + > From:nigelberlinguer > > Message-ID: > > > > | It should be noted though, that the POSIX requirement by "Guideline 7" > | is not guided

Handling options with optional arguments with getopts

2021-08-27 Thread nigelberlinguer
‐‐‐ Original Message ‐‐‐ On Friday, August 27, 2021 8:52 PM, Robert Elz wrote: > Date:Fri, 27 Aug 2021 17:20:39 + > From:nigelberlinguer > > Message-ID: > > > > | It should be noted though, that the POSIX requirement by "Guideline 7" > | is not guided

Handling options with optional arguments with getopts

2021-08-27 Thread nigelberlinguer
‐‐‐ Original Message ‐‐‐ On Friday, August 27, 2021 8:52 PM, Robert Elz wrote: > Date:Fri, 27 Aug 2021 17:20:39 + > From:nigelberlinguer > > Message-ID: > > > > | It should be noted though, that the POSIX requirement by "Guideline 7" > | is not guided

Re: Handling options with optional arguments with getopts

2021-08-27 Thread Kenneth Irving
On Fri, Aug 27, 2021 at 11:33 AM Lawrence Velázquez wrote: > > On Fri, Aug 27, 2021, at 1:20 PM, nigelberlinguer wrote: > > ‐‐‐ Original Message ‐‐‐ > > On Friday, August 27, 2021 4:02 PM, Robert Elz wrote: > > > XBD 12.2 guideline 7 is: > > > > > > Guideline 7: Option-arguments should

Re: Handling options with optional arguments with getopts

2021-08-27 Thread Robert Elz
Date:Fri, 27 Aug 2021 17:20:39 + From:nigelberlinguer Message-ID: | It should be noted though, that the POSIX requirement by "Guideline 7" | is not guided by actual portability in the technical sense but by a | rule written in the POSIX standard. Those

Re: Handling options with optional arguments with getopts

2021-08-27 Thread Lawrence Velázquez
On Fri, Aug 27, 2021, at 1:20 PM, nigelberlinguer wrote: > ‐‐‐ Original Message ‐‐‐ > On Friday, August 27, 2021 4:02 PM, Robert Elz wrote: > > XBD 12.2 guideline 7 is: > > > > Guideline 7: Option-arguments should not be optional. > > > > That is, if you want to be able to give an option

Handling options with optional arguments with getopts

2021-08-27 Thread nigelberlinguer
‐‐‐ Original Message ‐‐‐ On Friday, August 27, 2021 4:02 PM, Robert Elz wrote: > Date:Fri, 27 Aug 2021 15:05:52 + > From:nigelberlinguer via Bug reports for the GNU Bourne Again > SHell > > Message-ID: >

Re: Handling options with optional arguments with getopts

2021-08-27 Thread Robert Elz
Date:Fri, 27 Aug 2021 15:05:52 + From:nigelberlinguer via Bug reports for the GNU Bourne Again SHell Message-ID: <0IgsinjPxg5VSubCxyc64u9axdDTEubUNcQFmIaPyduotl2CyQ9g71uoLtpmXL2hUph1_eHzVRnEZ7vyyHFKqqy3OlPydQXccd2CkHyzpjA=@protonmail.com> | I am trying to use

Handling options with optional arguments with getopts

2021-08-27 Thread nigelberlinguer via Bug reports for the GNU Bourne Again SHell
I am trying to use getopts so one of the options can use an optional argument. Have seen many discussions online about using getopts to handle options with optional arguments, But also a lot of confusing arguments against many workarounds. Could bash getopts have a natural way to introduce an