4 ms·
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 s
by bxparks 6y ago
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