Commit graph

5394 commits

Author SHA1 Message Date
Ed Page
4da6374727
Merge pull request #3690 from epage/exclusive
fix(parser): Exclusive overrides required
2022-05-04 13:26:32 -05:00
Ed Page
61b8bbd218 fix(parser): Exclusive overrides required
`Arg::exclusive` is just another way of defining conflicts, so a
present-exclusive arg should override required like other conflicts.

Instead of going through the message of enumerating all other arguments
as exclusive, I shortcutted it and special case exclusive in the
required check like we do with conflicts.  The big downside is the
implicit coupling between the code paths rather than having a consistent
abstraction for covering conflicts.

This isn't a breaking change because if someone defined an exclusive arg
as a sibling to a required arg, the exclusive arg could never be used,
it always errored, and so no valid application can be written with it.

Fixes #3595
2022-05-04 12:25:44 -05:00
Ed Page
88472224dc perf(parser): Short-circuit exclusive validation 2022-05-04 12:13:51 -05:00
Ed Page
7deb724e08
Merge pull request #3687 from clap-rs/dependabot/github_actions/actions/checkout-3
chore(deps): bump actions/checkout from 2 to 3
2022-05-04 08:24:09 -05:00
dependabot[bot]
269cde50d5
chore(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 13:09:07 +00:00
Ed Page
7c90d68101
Merge pull request #3686 from clap-rs/dependabot/github_actions/actions/setup-python-3
chore(deps): bump actions/setup-python from 2 to 3
2022-05-04 08:08:39 -05:00
dependabot[bot]
a377f60011
chore(deps): bump actions/setup-python from 2 to 3
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 12:54:13 +00:00
Ed Page
cd102a29ea
Merge pull request #3685 from turrisxyz/feat/dependabot-github-actions
chore: Included githubactions in the dependabot config
2022-05-04 07:53:41 -05:00
naveensrinivasan
fcd78724f8
chore: Included githubactions in the dependabot config
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2022-05-03 21:36:38 -05:00
Ed Page
efd2253660
Merge pull request #3683 from epage/multicall
docs(multicall): Expand documentation in prep for stablization
2022-05-03 16:44:37 -05:00
Ed Page
aa6026f43c docs(multicall): Expand documentation in prep for stablization 2022-05-03 16:26:01 -05:00
Ed Page
f48c29c888
Merge pull request #3682 from epage/tutorial
docs(tutorial): Link the derive API to the builder API
2022-05-03 16:22:03 -05:00
Ed Page
8824ad0df0 docs(tutorial): Link derive to builder API 2022-05-03 15:44:54 -05:00
Ed Page
253e579781 docs(tutorial): Gradually add concepts for args 2022-05-03 15:40:11 -05:00
Ed Page
97a5c27d74 docs(tutorial): Clarify subcommand wording 2022-05-03 15:40:08 -05:00
Ed Page
396ea15a41 docs(tutorial): Link Parser attributes with Command functions 2022-05-03 15:40:04 -05:00
Ed Page
a1d0f05091
Merge pull request #3680 from epage/exe
fix(help): Offer a html_template variable for display name
2022-05-03 14:50:51 -05:00
Ed Page
3cfea3223b fix(help): Offer a html_template variable for display name
This is a step towards #992.  When help renders the application name, it
uses the `bin` template variable which is just the `bin` name with
spaces converted to ` `.  While having `app.exe sub` makes sense,
`app.exe-sub` does not.

To get around needing this for usage, we've created a `display_name`
field that is fairly similar but
- The root name is the `name` and not `bin_name`
- We always join with `-`

This means that the derived `bin_name` will only show up in usage.

For now, the default template has not been updated as that is a minor
compatibility change and should be in a minor release, at least.  I was
worried this would be a full breaking change.  The main case I was
worried about was cargo subcommands but our tests show they should just
work.
2022-05-03 14:34:47 -05:00
Ed Page
0240ec5493 chore: Release 2022-05-02 13:02:10 -05:00
Ed Page
5543315d3b docs: Update chaneglog 2022-05-02 13:02:03 -05:00
Ed Page
d33812f8a7
Merge pull request #3677 from epage/multicall
fix(multicall): Polish user messages
2022-05-02 12:59:19 -05:00
Ed Page
af3b789e4c fix(multicall): Consistently skip multicall bin in help 2022-05-02 11:50:30 -05:00
Ed Page
8cd59fa4e5 fix(multicall): More consistent whitespace in errors 2022-05-02 11:01:14 -05:00
Ed Page
f9fdb99ee8 fix(multicall): Disallow args on multicall binary
Set expectations for how this can be used and to make sure the right
errors are given.
2022-05-02 09:33:09 -05:00
Ed Page
ce727f1951 fix(error): Render actual usage for unrecognized subcommands
For some reason this code path diverged and manually constructed a
usage, not following any of our patterns for doing so.
2022-05-02 09:25:44 -05:00
Ed Page
5cd1a4070b fix(multicall): Show subcommands are required 2022-05-02 09:13:44 -05:00
Ed Page
414ae57a2a fix(multicall): Improve bad multicall binary error
By removing all arguments, we've switched from an "unrecognized
argument" error to a "unrecognized subcommand" error.  While the wording
has room for improvement, its at least progress on #2862.
2022-05-02 09:12:12 -05:00
Ed Page
86b0ea6ad4
Merge pull request #3675 from epage/repl
docs: Add REPL example
2022-05-02 06:47:45 -05:00
Ed Page
ec4735a44e docs: Add REPL example
This is to help in cases like #3668 and #3673
2022-05-02 06:27:57 -05:00
Ed Page
ff53b087e0 chore: Remove dead code 2022-05-02 05:52:18 -05:00
Ed Page
5e02ac1c19 chore: Release 2022-04-30 20:21:33 -05:00
Ed Page
f7b00adacf docs: Update chaneglog 2022-04-30 20:21:22 -05:00
Ed Page
b37c0a1f0f
Merge pull request #3670 from epage/panic
fix(builder): Fully recurse when building
2022-04-30 20:20:15 -05:00
Ed Page
0ecb6f4869 fix(builder): Fully recurse when building
Besides addressing the panic from assuming things were built when they
weren't, this should fix some completion issues for some people.

Fixes #3669
2022-04-30 20:02:06 -05:00
Ed Page
c6849e2ebd fix(debug): Moe detail 2022-04-30 19:07:42 -05:00
Ed Page
3ca1b77094 chore: Fix manifest 2022-04-30 06:37:57 -05:00
Ed Page
b01256be36 chore: Release 2022-04-30 06:36:33 -05:00
Ed Page
0c5400dadb chore: Release 2022-04-30 06:35:57 -05:00
Ed Page
09d21f4005 docs: Update changelog 2022-04-30 06:35:38 -05:00
Ed Page
bd653b90d9
Merge pull request #3667 from epage/exe
fix(help): Make help output more consistent
2022-04-30 06:30:30 -05:00
Ed Page
8df20478a4 style: Make clippy happy 2022-04-29 20:26:59 -05:00
Ed Page
ccf8634c19 fix(help): Provide correct context for help subcmd errors 2022-04-29 20:25:05 -05:00
Ed Page
1452c1e42b fix(help): Help subcommands usage includes requires arguments 2022-04-29 20:16:19 -05:00
Ed Page
37ebb71806 fix(help): write_help usage includes required arguments 2022-04-29 20:15:54 -05:00
Ed Page
d411e7a2fa docs(ref): Be more explicit with ArgEnums 2022-04-29 19:32:10 -05:00
Ed Page
515a37dba1 fix(debug): Improve debug output of bin building 2022-04-29 16:18:30 -05:00
Ed Page
bcde91b101 fix(debug): Update Command's debug statements 2022-04-29 16:07:47 -05:00
Ed Page
2edc1a2bdf test(help): Verify showing of required attributes 2022-04-29 15:46:15 -05:00
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