News for hackers. Stuff that matters.
Re:Bash code generator for command-line arguments by bxparks on Friday October 02, 2020 @01:06PM (#24664663)
I think technically you are correct about --help being valid. But in practice, I use --help only in an interactive context where the exit code does not matter so I've never been bitten by the subtle difference.

I tried using $0 years ago, but I didn't like seeing the full path name (or the "./parseflags.sh" string), or maybe it was because I often use shell alias, so the $0 becomes the alias name, or something like that. So now, I just replace the string "parseflags.sh" with the name of the script for each script. I think I tried using $(basename $0) at one point, but didn't like that either, though I don't remember why.

I hope that the template is simple enough that people can customize it as they wish.

Edit: Fix typo

There are no comments on this comment yet.