Commit graph

5322 commits

Author SHA1 Message Date
Ed Page
bbf6488ede fix(complete): Send debug statements to stderr 2022-04-27 15:49:58 -05:00
Ed Page
d4ddc5f6d6 clap(debug): More conflict details 2022-04-27 12:38:12 -05:00
Ed Page
f083ef92c5 fix(lex)!: Don't do prefix matching by default
Finding this a pain in `clap_complete`; not offering the benefits I
expected.
2022-04-27 12:38:12 -05:00
Ed Page
3d64ebacac test(complete): Option to verify examples 2022-04-27 09:03:47 -05:00
Ed Page
89c2b3bb0d docs(complete): Clarify examples 2022-04-27 08:55:12 -05:00
Ed Page
406bfbd3dc
Merge pull request #3655 from epage/test
test(complete): Use official extensions for snapshots
2022-04-22 16:32:38 -05:00
Ed Page
55bfacbf43 test(complete): Use official extensions for snapshots 2022-04-22 16:21:10 -05:00
Ed Page
1e181770ac
Merge pull request #3653 from epage/color
fix(clap): Allow disabling color with debug
2022-04-22 12:49:16 -05:00
Ed Page
5ae9c75324 fix(clap): Allow disabling color with debug 2022-04-22 12:32:58 -05:00
Ed Page
3fa690e888
Merge pull request #3652 from epage/stdio
test(output): Ensure correct streams
2022-04-22 11:06:05 -05:00
Ed Page
1e2471649e test(output): Ensure correct streams
This is to prevent #3648 from happening again
2022-04-22 10:56:47 -05:00
Ed Page
d43dd6eb7f
Merge pull request #3650 from epage/test
test(group): Verify overrides required
2022-04-22 07:15:58 -05:00
Ed Page
4e20af3498 refactor(parser): Reduce visibility of parser fields 2022-04-22 07:03:07 -05:00
Ed Page
e7471eb546 test(group): Verify overrides required
This adds a test for de89c050c9 that
confirms #3647 is fixed

Fixes #3647
2022-04-22 07:01:53 -05:00
Ed Page
d805c6031d chore: Release 2022-04-22 06:52:05 -05:00
Ed Page
d09aec2c14 docs: Update changelog 2022-04-22 06:51:59 -05:00
Ed Page
61514bf6d1
Merge pull request #3646 from arlosi/fix-stdout
fix: Mixup between stderr and stdout introduced in v3.1.11
2022-04-22 06:51:22 -05:00
Arlo Siemsen
854017b478 fix: Mixup between stderr and stdout introduced in v3.1.11 2022-04-22 02:09:22 -05:00
Ed Page
a46ee83224 chore: Release 2022-04-21 20:08:49 -05:00
Ed Page
62e9d2dfe1 docs: Update changelog 2022-04-21 20:08:35 -05:00
Ed Page
8505c47e2e
refactor(validator): Decouple parser (#3645)
* fix(validate): Consistent conflict behavior

We had two different implementations of conflicts
- Validating conflicts
- Allowing conflicts to override `required`
  - Missing members of a group conflicting with each other
  - Missing symmetric conflicts (A conflicts with B so B conflicts with
    A)

This consolidates their implementations which should fix overriding of
`required`.

* fix(validate): Overrides always ignore required

Before, if two arguments were required *and* overrode each other, then
`cmd --opt=1 --other=2` succeded but `cmd --other=2` failed despite
ignoring `--opt=1`.  Requiring `--opt=1` to be present but unavailable
doesn't help anyone and makes the behavior less predictable.

Now both commands will have the same behavior.

* refactor(parser): Pull out long-help determination

This isn't a parser policy but command-level policy.

* refactor(help): Make bool's meaning clearer

* refactor(help): Consolidate help errors

* refactor(help): Move help writing down a layer

* refactor(parser): Parser is solely responsible for populating ArgMatches

* refactor(validator): Decouple parser
2022-04-21 18:14:17 -05:00
Ed Page
9d523012fe refactor(validator): Decouple parser 2022-04-21 16:31:04 -05:00
Ed Page
6229e78bc6 refactor(parser): Parser is solely responsible for populating ArgMatches 2022-04-21 16:24:10 -05:00
Ed Page
02ffd59830 refactor(help): Move help writing down a layer 2022-04-21 16:14:11 -05:00
Ed Page
ebeade91bf refactor(help): Consolidate help errors 2022-04-21 16:12:01 -05:00
Ed Page
6a9a5d05b0 refactor(help): Make bool's meaning clearer 2022-04-21 16:01:47 -05:00
Ed Page
639f9e8849 refactor(parser): Pull out long-help determination
This isn't a parser policy but command-level policy.
2022-04-21 15:49:02 -05:00
Ed Page
a484f622de fix(validate): Overrides always ignore required
Before, if two arguments were required *and* overrode each other, then
`cmd --opt=1 --other=2` succeded but `cmd --other=2` failed despite
ignoring `--opt=1`.  Requiring `--opt=1` to be present but unavailable
doesn't help anyone and makes the behavior less predictable.

Now both commands will have the same behavior.
2022-04-21 15:23:05 -05:00
Ed Page
de89c050c9 fix(validate): Consistent conflict behavior
We had two different implementations of conflicts
- Validating conflicts
- Allowing conflicts to override `required`
  - Missing members of a group conflicting with each other
  - Missing symmetric conflicts (A conflicts with B so B conflicts with
    A)

This consolidates their implementations which should fix overriding of
`required`.
2022-04-21 15:03:56 -05:00
Ed Page
6e778679cc chore: Release 2022-04-20 08:51:43 -05:00
Ed Page
b7bd298385 docs(man): Update changelog 2022-04-20 08:51:35 -05:00
Orhun Parmaksız
2740be259c
fix(man): show the environment info with separate paragraph (#3631)
This commit updates the man page renderer to use a relative margin
indent for environment variable text instead of appending to the
existing help text.

Signed-off-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
Fixes: #3630
2022-04-20 08:50:11 -05:00
Ed Page
cad55a2de2 chore: Release 2022-04-19 11:50:17 -05:00
Ed Page
b1623b7e3c
Merge pull request #3643 from bgilbert/build
fix(man): Explicitly depend on clap 3.1.10
2022-04-19 11:49:55 -05:00
Benjamin Gilbert
d50ab883aa fix(man): Explicitly depend on clap 3.1.10
Command.build() is not available in 3.1.9.

Fixes: 8f182067e3 ("feat(clap): Publicly expose `Command::build`")
2022-04-19 12:30:39 -04:00
Ed Page
0194568b03 chore: Release 2022-04-19 10:31:52 -05:00
Ed Page
62b1e4874a docs: Update changelog 2022-04-19 10:28:28 -05:00
Ed Page
c818ef401d
Merge pull request #3642 from epage/build
feat(clap): Publicly expose `Command::build`
2022-04-19 10:27:22 -05:00
Ed Page
8f182067e3 feat(clap): Publicly expose Command::build
`Command::_build_all` started as an internal function for
`clap_complete` as a stopgap until #2911.  Overtime, we've been finding
more cases where this function needs to be called, so now we're going to
fully embrace it until #2911 so people aren't scrared off by the hidden
implementation from using it.

This was inspired by #3602

Comptibility: Though this adds a deprecation which we general reserve
for minor or major versions, this is enough of a corner case that I'm
fine doing this in a patch release.
2022-04-19 10:13:43 -05:00
Ed Page
eddc04cbcc chore: Release 2022-04-15 16:17:02 -05:00
Ed Page
84bcab77e5 docs: Update changelog 2022-04-15 16:16:56 -05:00
Ed Page
83f1b165ba perf(lex): Drop a dependency
With the size of our haystacks, it doesn't seem worth pulling in an
extra depedency.  Pretty torn on this because nearly anything else will
pull it in (regex, tokio, etc).
2022-04-15 16:15:36 -05:00
Ed Page
7598c000f9 chore: Release 2022-04-15 14:39:14 -05:00
Ed Page
d05c5dac41 docs: Update changelog 2022-04-15 14:38:58 -05:00
Ed Page
4abf9d7f2e
Merge pull request #3636 from epage/derive
fix(derive): Couple derive version to clap
2022-04-15 14:35:22 -05:00
Ed Page
027f2511c6
Merge pull request #3634 from turrisxyz/naveen/feat/set-perms-actions
Set permissions for GitHub actions
2022-04-15 14:28:33 -05:00
Ed Page
ed57342bdd fix(derive): Couple derive version to clap
While `clap` depends on `clap_derive`, `clap_derive` inherently has a
dependency on `clap` because it generates code assuming at least a
specific clap version.  If a new `clap_derive` is used with an old
`clap`, it'll generate code that won't compile.

We've kept things loose because of
- Bad experiences with overly constrained version reqs
- To not force new `clap` versions to release `clap_derive`.
- People should have a lock file anyways

The downsides:
- `cargo install` does not use `Cargo.lock` by default, required
  `--locked`
- If we want people to not skip non-patch releases when upgrading, we
  need it to not be a pain
2022-04-15 14:09:28 -05:00
Ed Page
297b9cf594 chore: Release 2022-04-15 14:05:51 -05:00
Ed Page
b3cbfd0ae0 docs(man): Update changelog 2022-04-15 14:05:29 -05:00
Ed Page
7849c35a3e
Merge pull request #3635 from epage/port
feat: Expose clap_lex
2022-04-15 14:00:28 -05:00