Commit graph

5347 commits

Author SHA1 Message Date
Ed Page
7cdce9cabe refactor(test): Use snapbox's diffs 2022-04-29 15:32:25 -05:00
Ed Page
ba0301d9b4 refactor(builder): Group related build functions 2022-04-29 09:36:28 -05:00
Ed Page
7113e46388 fix(builder): Deprecate public Command::_build_bin_names 2022-04-29 09:21:42 -05:00
Ed Page
397e8443f9 refactor(builder): Consistently use internal function 2022-04-29 09:16:20 -05:00
Ed Page
d411e7a2fa docs(ref): Be more explicit with ArgEnums 2022-04-29 19:32:10 -05:00
Ed Page
0a1cfe3557 docs(changelog): Start v4 section 2022-04-29 08:21:23 -05:00
Ed Page
9bf01e916d
Merge pull request #3656 from epage/complete
feat(complete): Skeleton for Rust-driven completions
2022-04-27 16:24:01 -05:00
Ed Page
1922b892ae fix(complete): Correctly detect positionals 2022-04-27 15:53:02 -05:00
Ed Page
53ae382c99 feat(complete): Add debug aids 2022-04-27 15:49:58 -05:00
Ed Page
4b9dd3fbbb test(complete): Cover long flags 2022-04-27 15:49:58 -05:00
Ed Page
c9b6d62ba7 test(complete): Cover subcommands 2022-04-27 15:49:58 -05:00
Ed Page
ca4439a93a fix(complete): Make short flags additive 2022-04-27 15:49:58 -05:00
Ed Page
f4892848da fix(complete): Allow subcommands in escaped arguments 2022-04-27 15:49:58 -05:00
Ed Page
6895806566 fix(complete: Use correct value name for IFS 2022-04-27 15:49:58 -05:00
Ed Page
2701f48023 fix(complete): Don't require IFS
This makes testing easier
2022-04-27 15:49:58 -05:00
Ed Page
fe70fbc733 fix(complete): Only use IFS between items 2022-04-27 15:49:58 -05:00
Ed Page
a574f226eb feat(complete): Look up partial matches 2022-04-27 15:49:58 -05:00
Ed Page
63e0fd5c50 fix(complete): Don't count flags as positionals 2022-04-27 15:49:58 -05:00
Ed Page
0112ad8b4f refactor(complete): Extract arg value completion 2022-04-27 15:49:58 -05:00
Ed Page
458b4ae9cc feat(complete): Escaped args are always positional 2022-04-27 15:49:58 -05:00
Ed Page
44443503cc feat(complete): Only list for current positional 2022-04-27 15:49:58 -05:00
Ed Page
2d70927be6 fix(complete): Detect which argument is being completed 2022-04-27 15:49:58 -05:00
Ed Page
018b8bd565 feat(complete): Complete possible values 2022-04-27 15:49:58 -05:00
Ed Page
5882e3df3b feat(complete): Basic subcommand support 2022-04-27 15:49:58 -05:00
Ed Page
9f9e410c6d feat(complete): Minimal rust-completion
Inspired by argcomplete, this provides Rust-implemented completions
- Only bash for now
- No subcommand support
- No flag value support
- No special settings support
- No handling of positions within positionals
- No prioritizing of required or removing of conflicts (including
  self-conflicts)
2022-04-27 15:49:58 -05:00
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