docopt.rs icon indicating copy to clipboard operation
docopt.rs copied to clipboard

No warning that "<path> | -" can never match the latter

Open aidanhs opened this issue 10 years ago • 2 comments
trafficstars

It might be nice to warn that if you have a conditional, the catch-all should be at the end.

aidanhs avatar Jan 12 '15 20:01 aidanhs

Mmhmm. Yeah, maybe. I probably won't budget time to work on this, so if someone else wants to submit a PR, that's fine. So long as it doesn't add any significant complexity to the implementation, I'd be happy to maintain it.

BurntSushi avatar Jan 13 '15 02:01 BurntSushi

In fact, it'd have to be an error at compile time.

But perhaps this is actually a useful pattern - it acts as a form of hinting for possible 'magic' values of arg_path. I'll have a think about how I'd tweak the docs.

aidanhs avatar Jan 13 '15 11:01 aidanhs