Commit graph

24 commits

Author SHA1 Message Date
Kevin K
a5e25a563c tests(run_tests.py): update to new error messages 2015-05-06 12:36:12 -04:00
Kevin K
c445a100f9 tests(run_tests.py): uses new error messages 2015-05-06 12:36:03 -04:00
Kevin K
73d5a974eb tests(colors): removes ansi color codes before testing 2015-05-05 22:05:02 -04:00
Sebastian Thiel
0535cfb0c7 fix(did-you-mean): for review
* 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
2015-05-05 17:12:20 -04:00
Sebastian Thiel
d3761a2c20 refactor(run_tests): python 2/3 compatibility
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.
2015-05-05 17:12:20 -04:00
Sebastian Thiel
1cc2deb291 feat(did-you-mean): for possible values
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
2015-05-05 17:12:20 -04:00
Sebastian Thiel
94dd9da1c5 tests(main.rs): add long --Option to -O
To facilitate running different branches of code that looks
rather similar.
2015-05-05 17:12:20 -04:00
Sebastian Thiel
0dd095f975 refactor(did-you-mean): dedup. thanks to suffix
That way, we use the prefix previously used by clap, but add our
particular 'did-you-mean' phrase as a suffix.
2015-05-05 17:12:20 -04:00
Sebastian Thiel
52a0b8505c feat(did-you-mean): for long flags (i.e. --long)
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
2015-05-05 17:12:20 -04:00
Sebastian Thiel
06e869b518 feat(did-you-mean): for subcommands
If an argument is not understood as subcommand, but has a
high-confidence match in the list of all known subcommands, we will use
this one to print a customized error message.

Previously, it would say that a positional argument wasn't understood,
now it will say that a subcommand was unknown, and if the user meant
`high-confidence-candidate`.

If the argument doesn't sufficiently match any subcommand, the default
handling will take over and try to treat it as positional argument.

* added dependency to `strsym` crate
* new `did_you_mean` function uses `strsim::jaro_winkler(...)` to look
  for good candidates.

Related to #103
2015-05-05 17:12:20 -04:00
Sebastian Thiel
d17dcb2920 imp(clap-test): simplified make test invocation
* assure `make test` works on OSX as well
* simplified entire makefile, by basically removing sed invocations to
  manipulate the Cargo.toml file under source control.
* *works for me* predicate

This should probably be tested on another system as well, just to be
sure it makes sense for everyone.
2015-05-05 17:12:20 -04:00
Kevin K
a87d970c93 tests(run_test.py): update help messages to new fixes 2015-05-04 22:01:28 -04:00
Kevin K
45e481cb1c tests(main.rs): adds new features to tests 2015-05-04 22:01:28 -04:00
Kevin K
7ab5037402 tests(run_tests.py): update error messages 2015-05-03 16:20:12 -04:00
Kevin K
713cab8a4f tests(run_tests.py): update known good error messages to new messages 2015-05-03 00:38:18 -04:00
Kevin K
cf7f6c80cd tests(usage): update known good tests to new usage strings 2015-04-30 19:32:51 -04:00
Kevin K
42d9b142b7 tests(run_tests.py): update tests to allow new shorthand multi values 2015-04-30 15:28:01 -04:00
Kevin K
dd693ab86d tests(usage): update to smart usage errors 2015-04-30 12:13:03 -04:00
Kevin K
349927bfb1 tests(run_test.py): update tests to new error msgs 2015-04-27 00:54:21 -04:00
Kevin K
ac161fa3f4 tests(run_tests.py): update for new help format 2015-04-25 22:24:06 -04:00
Kevin K
79e26a6b3e tests(clap-tests): add test support for new from_usage features 2015-04-13 14:59:34 -04:00
Kevin K
e2488e50e4 tests(subcommand help): change to new usage generation known good 2015-04-09 18:39:29 -04:00
Kevin K
08f130612a tests(clap-tests): add subcommand tests 2015-04-08 18:01:06 -04:00
Kevin K
52415f4ba3 chore(tests): rename claptests->clap-tests 2015-04-08 17:10:59 -04:00
Renamed from claptests/run_tests.py (Browse further)