The `display-suffix` option for `edit:complex-candidate` was [deprecated in Elvish v0.14.0][1] and
removed in v0.15.0 (latest version is v0.16.3), so this commit changes the Elvish completions
generation to use the `display` option instead.
Additionally, this commit changes assignments to use the `var` and `set` keywords as using
`name = value` without these keywords ('legacy assignment form') [will be deprecated][2].
[1]: https://elv.sh/blog/0.14.0-release-notes.html
[2]: https://elv.sh/ref/language.html#legacy-assignment-form
* feat(arg_value): ArgValue can be used for possible_values
Through the ArgValue it is possible:
* `hide` possible_values from showing in completion, help and validation
* add `about` to possible_values in completion
* Resolved a few change-requests by epage
* make clippy happy
* add ArgValue::get_visible_value
* remove verbose destructering
* rename ArgValue::get_hidden to ArgValue::is_hidden
* add test for help output of hidden ArgValues
* Documentation for ArgValue
There is an issue that required to implement From<&ArgValue> for
ArgValue. We should probably find a solution without that.
* fix requested changes by epage
* fix formatting
* add deref in possible_values call to remove From<&&str>
* make clippy happy
* use copied() instad of map(|v|*v)
* Finishing up for merge, hopefully
* changes requested by pksunkara
This addresses a bug that causes duplicate flags reported in user-facing
error messages when two flags require one-another but also are required
under other conditions. The fix involves removing duplicates in unrolled
requirements, which addresses the user-facing aspect of this bug.
* fix(generate): Better subcommand completion in fish
* Prevent completing subcommands that were already completed
* Make sure all parent subcommands actually existent
Partially fixes#2715
* Added Test
* fix(generate) Improve subcommand testing
This now also disables the completion of sub_subcommands options for
subcommands.
* Don't suggest `help` or `--help` when not applicable
* Apply suggestions from code review
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
* Update test usage to match intended
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
* Add placeholders for Cookbook and Cheatsheet pages in the website
* Update site/content/cheatsheet.md
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
This returns `"{a\t,b\t}"` instead of `"a b"` for possible_values
completion. Therefore fish displays and therefor hides the empty
description after the `\t`.
Fixes#2727
Because we gradually build the `ArgGroup` as we parse the YAML, we don't
use `ArgGroup::new`. Clap3 introduced an internal `id` in addition to
the public `name` and it appears that this custom initialization code
was not updated.
This shows the problem with publically exposing `impl Default`.
Choices:
- Remove `impl Default`
- Always valid
- Requires spreading invariants
- Callers can't implement code the same way we do
- Add `ArgGroup::name`
- Can be constructed in an invalid state
- Centralizes invariants
- A caller could implement code like the yaml logic
I decided to go with `ArgGroup::name`.
Fixes#2719
Before, validating UTF-8 was all-or-nothing and would cause a `panic` if
someone used the right API with non-UTF-8 input.
Now, all arguments are validated for UTF-8, unless opted-out. This
ensures a non-panicing path forward at the cost of people using the
builder API that previously did `value_of_os` need to now set this flag.
Fixes#751
This provides a skeleton README for `clap_generate`, including a
one-line summary and a link to the docs to guide people to the examples
there.
In doing so, I tried to clarify and be consistent in what role
this crate plays. While it is very general, being too general in the
description can lead people to not understand where they could use it.
Fixes#1711
Previously, we paniced. This is one less reason people have to call
lower level `get_matches` to get the commonly expected behavior, making
it more likely for the Rust community to "do the right thing"
Fixes#2659