←back to thread

203 points dahlia | 1 comments | | HN request time: 0.212s | source
Show context
SloopJon ◴[] No.45154031[source]
I don't see anything in the post or the linked tutorial that gives a flavor of the user experience when you supply an invalid option. I tried running the example, but I've forgotten too much about Node and TypeScript to make it work. (It can't resolve the @optique references.) What happens when you pass --foo, --target bar, or --port 3.14?
replies(1): >>45154447 #
macintux ◴[] No.45154447[source]
I had a similar question: to me, the output format “or” statement looks like it might deterministically pick one winner instead of alerting the user that they erred. A good parser is terrific, but it needs to give useful feedback.
replies(1): >>45157297 #
1. Dragging-Syrup ◴[] No.45157297[source]
Absolutely; I think calling the function xor would be more appropriate.