Re:Argbash – Bash Argument Parsing Code Generator
by fsckboy on Monday March 20, 2023 @05:32PM
(#35239075)
i don't know where you learned English composition, but I can't follow your critique and are you pointing out your preferences (which may well match gnu or bsd standards) or things that actually make a difference? Are you pointing out all the flaws or the correct ways, i'm having to eyeball diff. Use more of your words.
while
do
doesn't seem substantially worse/confusing compared to while;do unless you have some reason?
spacing out ;; does it make a difference? or do you like things spaced out?
Re:Argbash – Bash Argument Parsing Code Generator
by sacnoradhq on Monday March 20, 2023 @06:13PM
(#35239544)
Flagged for not being a professional response to constructive feedback.
Re:Argbash – Bash Argument Parsing Code Generator
by yesenadam on Monday March 20, 2023 @06:23PM
(#35239666)
I thought it was "professional", helpful, and a great comment. I didn't think yours was constructive, just unhelpfully treating a different formatting style as objectively worse, in an unfriendly way. "Be kind"! It was also hard to parse, as the GP pointed out.
edit: You changed your comment after I wrote this. Now it mentions that you flagged the GP. That's ridiculous.
Re:Argbash – Bash Argument Parsing Code Generator
by sacnoradhq on Monday March 20, 2023 @06:34PM
(#35239805)
You have way too much time on your hands and seem determined to argue nonconstructively. Have a good one.
Re:Argbash – Bash Argument Parsing Code Generator
by yesenadam on Monday March 20, 2023 @06:35PM
(#35239818)
> You have way too much time on your hands and seem determined to argue nonconstructively. Have a good one.
Please refresh on the guidelines. And reconsider who has been "constructive" vs "nonconstructive" in this thread.
Re:Argbash – Bash Argument Parsing Code Generator
by databasher on Monday March 20, 2023 @05:43PM
(#35239203)
If you refer to my example above, you'll find that Bash's native "getopts" handles long options just fine. It accepts short option `-`, with an argument. This handles --long-options and --long-options=with-arguments.
Feel free to use your own formatting preferences.
Re:Argbash – Bash Argument Parsing Code Generator
by sacnoradhq on Monday March 20, 2023 @06:22PM
(#35239646)
- while...; do / if ...; then
- space before ;;
- no space before case match
- use util-linux getopt because getopts doesn't handle long args
- DRY with a die() function rather than exits littered all over