Damus
Haelwenn /элвэн/ :triskell: · 2w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpq0jkeeqdl7q22gw8ax79e4r84e6smhz2wk3ew80ph06nljukle83ql7euty nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqf67qrzm95xe497g0jda70x6uxwr9ru2...
Laurent Bercot profile picture
@Haelwenn /элвэн/ :triskell: @navi You can't use getopt since the first argument can be negative and kill does not enforce a -- at the end of the options.

You need to parse the command line unconditionally interpreting the last word as an argument and doing a limited getopt on the start. And if you get kill -1 -2 -3 then it's ambiguous.

I would love to toss the -signum usage, but it's so fossilized by history that you can't. kill -9 -1 is the common definition of a nuke, and kill -s KILL -1 just doesn't pack the same punch.

If you want another example, try implementing test following the exact specification. It's a true horror show.
1
Haelwenn /элвэн/ :triskell: · 2w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpq0jkeeqdl7q22gw8ax79e4r84e6smhz2wk3ew80ph06nljukle83ql7euty nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqf67qrzm95xe497g0jda70x6uxwr9ru2j39sg38axfj4ff05c979q3gaasw Yeah, you can't use getopt to parse it entirely, so either you break you...