give a useful error for "garble build -tiny"
We've had confused users a handful of times by now. And it's reasonable to expect flags to be after the command, as that's how flags work for cmd/go itself. I don't think we want to mix our flags with Go's, or start accepting flags in either place. Both seem like worse solutions long-term, as they can add confusion. However, we can quickly give a useful hint when a flag is misplaced. That should get new users unblocked without asking for help. We use a regular expression for this purpose, because it doesn't seem like a FlagSet supports what we need; to detect whether an argument is one of our flags, without actually applying its value to the flagset. Our flagset would also error on Go's flags, which we don't want.pull/438/head
parent
5abd3c468d
commit
4e97811a62
Loading…
Reference in New Issue