You can now use ArgName::variants() to get a Vec<&'static str> of
vairant names (Nice for Arg::possible_values()). It's not as good as
implementing Iterator for the enum, but that can't be done without being
able to concat AST tokens in order to make an "EnumIter" type which
implements iterator and keeps track of when to yield None. But the
overall intent of this issue was to be able to iterate variant names,
which is now possible.
Closes#119
* unknown subcommand message altered to use similar language as is used
everywhere around clap. Namely, we say 'invalid' instead of 'unknown'
* 'did-you-mean' message separator changed from '. ' to '\n\t'
Related to #103
That way, it will run on travis as well, which comes with python 2
by default, and just doesn't have python 3 pre-installed.
It would probably take to much time to install, especially considering
it's super easy to have to script work in both worlds.
Run the python based --release mode tests as well. They are mainly
concerned with user facing messages, which are as important as the
internal tests run `cargo test`.
More about this can be found [here](http://goo.gl/vt07f7).
It's somewhat unnecessary, but I thought it might be good in preparation
for the next commit.
There now is a single method which deals with formatting the
'did-you-mean' message, supporting different styles to cater all the
various needs that have arisen thus far, with enough potential to be
easily extended in future through a little helper-enumeration whose
variants can possibly take values.
*NOTE*: We might still want to have a look at where the did-you-mean
message should be located for best effect.
Related to #103
This is done in preparation for adding suggestions.
**NOTE**: We will now always use the ...
`"\"{}\" isn't a valid value for '{}'{}"`
... format, even though in one occasion, only a ...
`"\"{}\" isn't a valid value for {}{}"`
... format was used.
Hope that's alright and not breaking the world. At least, it doesn't
break any of the existing tests.
Long arguments now have a special case when saying they are unknown, as
we will match it against all known long flags and suggest the best match
to be used instead.
TODO: refactor to just write a suffix with did-you-mean information.
Related to #103