Re:How Old School C Programmers Process Arguments
by setr on Sunday January 28, 2018 @02:01AM
(#16250199)
Wouldn't an empty flag be caught by the default handler? And duplicate flag usage isn't inherently incorrect (-vvv); handling that would be in the switch statement, and if its actually a boolean switch, then duplicates would just be ignored anyways, so harmless.
[ Parent
| on HN ]
Re:How Old School C Programmers Process Arguments
by kstenerud on Sunday January 28, 2018 @02:06AM
(#16250213)
The empty flag(s) would be processed by *s != '\0' and result in noops. The point in the early days wasn't to handle corner cases like these gracefully. That only came later as the audience for shell commands widened.