Commit graph

387 commits

Author SHA1 Message Date
Ed Page
b39d3d4f2b docs(derive): Make raw attribute more discoverable
Based on feedback in #3189
2022-05-30 18:41:10 -05:00
Yuri Astrakhan
3fd5e4bc33
fix cargo.toml link 2022-05-27 07:43:09 -04:00
Ed Page
fcdd31781b feat(parser): Allow people to plug into 'value_parser' macro
For most users, this won't be worth doing, they can just specify the
parser if needed.  Where this has value is crates that integrate custom
types into clap, like creating click-like file integration.  See
https://click.palletsprojects.com/en/8.0.x/arguments/#file-arguments
2022-05-25 14:12:27 -05:00
Ed Page
177511dab1 fix: Deprecate validator / validator_os
`validator_regex` is being ignored for now as I await on a comment
period for #3743
2022-05-25 12:57:11 -05:00
Ed Page
eda0ca54c1 fix(parser): Simplify the common getter API
Clap has focused on reporting development errors through assertions
rather than mixing user errors with development errors.  Sometimes,
developers need to handle things more flexibly so included in #3732 was
the reporting of value accessor failures as internal errors with a
distinct type.  I've been going back and forth on whether the extra
error pessimises the usability in the common case vs dealing with the
proliferation of different function combinations.  In working on
deprecating the `value_of` functions, I decided that it was going to be
worth duplicating so long as we can keep the documentation focused.
2022-05-25 10:50:42 -05:00
Ed Page
ed45de2f03 fix(parser): Clean up remove types
The remove functions no longer return `Arc` but the core type, at the
cost of requiring `Clone`.  I originally held off on this
in #3732 in the hope of gracefully transition the derive and requiring
`Clone` would have been a breaking change but when it came to #3734, I didn't
find a way to make it work without a breaking change, so I made it
opt-in.  This means I can force the `Clone` requirement now.

I added the requirement for `Clone` everywhere else in the hopes that in
the future, we can drop the `Arc` without a breaking change.
2022-05-24 16:25:07 -05:00
Ed Page
b3847d12f0 docs(ref): Update for _ref derive 2022-05-24 14:53:08 -05:00
Ed Page
33e94df212 docs(example): Update for value_parser 2022-05-24 14:53:08 -05:00
Ed Page
15616bbd13 fix(error): Remove usage from value validation
When to show usage?  We are currently mixed about it.  For `validator`,
we didn't show it at all.  Sometimes we show the used arguments and
sometimes we don't.

With `ValueParser`, I ran into the problem that we weren't showing the
used arguments like we had previously in some cases.  In deciding how to
solve this, I went with the simplest route for now and removed it as the
usage likely doesn't add much context to help people solve their
problem, more so the recommendation for help.  We'll see how the
feedback is on this and adjust.
2022-05-23 20:56:04 -05:00
Ed Page
e23800e10e doc(derive): Update for value_parser 2022-05-20 20:02:23 -05:00
Ed Page
a35df14caf feat(derive): Opt-in to inferred value_parser 2022-05-20 19:25:20 -05:00
Ed Page
686b0379ce feat(multicall): Stablize multicall
`multicall` allows you to have one binary expose itself as multiple
programs, like busybox does.  This also works well for user clap for
parsing REPLs.

Fixes #2861
2022-05-20 12:20:40 -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
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
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
d411e7a2fa docs(ref): Be more explicit with ArgEnums 2022-04-29 19:32:10 -05:00
Ed Page
5be61a199c docs(examples); Call out optional subcommands 2022-04-01 09:27:29 -05:00
shir0kamii
fb4755d1c3 feat(derive): Don't abort when non-unit variant is skipped 2022-03-31 18:49:21 +02:00
shir0kamii
ee3d12ec56 fix(derive): Abort on non-unit variant 2022-03-30 03:49:14 +02:00
Ed Page
731d18f300 docs(examples): Fix help output 2022-03-25 07:20:46 -05:00
Ed Page
429e1d3f31 docs: Fix examples
CI didn't run for #3570, so we missed that some things were off on
Windows.
2022-03-23 12:31:13 -05:00
Ed Page
db863de6c1 docs(examples): Show how to do default subcommands
While we don't have a built-in mechanism, its relatively easy to support
with the APIs we provide.

Inspired by #3566
2022-03-23 11:08:07 -05:00
Ed Page
bdd5cf17f8 docs(examples): Show IP Address 2022-03-14 09:53:31 -05:00
Ed Page
4842f07045 docs(examples): Show duration parsing 2022-03-14 09:49:46 -05:00
Ed Page
c230c72120 docs(examples): Allow any path 2022-03-14 09:46:33 -05:00
Ed Page
ce9e2cba8f docs(examples): Show implicit parser 2022-03-14 09:43:17 -05:00
Ed Page
a8ffebbab9 docs(examples): Generalize key-value example 2022-03-14 09:38:04 -05:00
Ed Page
dbe8c0c957 docs(tutorial): Prefer custom parsing to validation 2022-03-14 09:31:40 -05:00
Matt Fellenz
17193bd074
docs(derive): Builder/Derive interop reference (#3515)
Fixes #3500
2022-03-07 14:43:51 -06:00
Jörg Wunderlich-Pfeiffer
92e1666868 docs: Fix link to example 2022-03-06 11:05:23 +01:00
Pavan Kumar Sunkara
8a9403a1df Fixes #3464 2022-03-05 14:25:12 +00:00
Ed Page
14ea156218 docs: Annotate more places with required features 2022-03-03 12:32:29 -06:00
Ed Page
d2863a228c
Merge pull request #3529 from epage/attrib
docs(derive): Shift structure around lang->builder
2022-03-02 18:18:34 -06:00
Lucas Kent
0fe8ca7d3c docs(derive): Shift structure around lang->builder
Before, we had the focus on attributes and how they were impacted by
various features.  Now we separate out language items and put both magic
and raw attributes under the type of attribute (command, arg, etc)
2022-03-02 16:14:51 -06:00
Steve Klabnik
f89c8f4da2 Fix a typo in an example 2022-03-02 08:41:08 -06:00
Moritz Mœller
22efb36983
Fixed broken Command Attributes link 2022-02-24 13:39:53 +01:00
Nils Homer
c13cd89ceb
Fix link to contributing 2022-02-22 20:36:54 -08:00
Ed Page
a7b7d43582 docs(derive): Call out 'Command' relationship 2022-02-22 18:09:47 -06:00
Ed Page
cb9cb251a9 style: Clean up 2022-02-22 17:47:46 -06:00
Ed Page
f7419ec3d2 docs(examples): Be explicit about example topics 2022-02-22 08:43:33 -06:00
Ed Page
c55989459f docs(tutorial): Examples as next step 2022-02-22 08:37:13 -06:00
Ed Page
7e51f7c03d docs(derive): Call out different subcommand arg syntaxes 2022-02-22 08:32:18 -06:00
Ed Page
517b8e4233 docs(derive): Clarify the break down 2022-02-22 08:31:02 -06:00
Ed Page
9946579fc9 docs(tutorial): Clarify to debug_assert in tests 2022-02-22 08:29:53 -06:00
Ed Page
3eee9add96 docs(derive): Add tip about derive reference
One of the concerns in #3490 was the finding of derive reference. Having
it at the end for a "next step" seems appropriate.
2022-02-22 08:27:35 -06:00
Ed Page
e8218733c2 docs(derive): Clarify subcommand arg syntax 2022-02-22 08:23:58 -06:00
Ed Page
bc2be89f46 docs(example): Remove builder references
Fixes #3489
2022-02-18 10:50:49 -06:00
Ed Page
976f3d500a
Merge pull request #3473 from epage/derive
fix: Change `IntoApp::into_app` to `CommandFactory::command`
2022-02-15 09:33:44 -06:00
Ed Page
360c4d6b8a docs: Update to new command! macro 2022-02-15 08:54:59 -06:00
Ed Page
ddac492302 fix: Rename IntoApp to CommandFactory
This is part of the `App` rename.

Previously, I was concerned about not being able to deprecate

For backwards compatibility, we still expose the `IntoApp` name.
2022-02-15 08:24:00 -06:00
Ed Page
c3fec1fa75 fix: Update derive->Command function name
No good solution for transitioning the trate name, unfortnately, since
we can't mark `use`s as deprecated (we can, it just does nothing).

I got rid of the `into` prefix because that implies a `self` parameter
that doesn't exist.
2022-02-14 16:04:10 -06:00
Ed Page
e8010e79a9 refactor: Update app variables to cmd 2022-02-14 15:55:56 -06:00
Ed Page
c4144d7d6c docs: Update App references to Command 2022-02-14 15:33:49 -06:00
Ed Page
3475555de6 fix(help): Use standard alternate syntax for subcommands 2022-02-14 21:18:33 -06:00
Ed Page
9a83ada940 fix(help): Separate subcommand flags 2022-02-14 16:20:33 -06:00
Ed Page
8c5e42e0fb fix(help): Show subcommand flags in same order as usage 2022-02-14 16:20:03 -06:00
Ed Page
adb2b03890 docs(examples): Show pacman-style help
Looking at how `App::usage` member is used, and didn't realize we had
this special logic.
2022-02-14 12:22:01 -06:00
Ed Page
97e36451cf docs: Update stale references to AppSettings 2022-02-11 15:58:12 -06:00
Ed Page
8f201d8dd6 docs: Stop demonstrating SubcommandRequiredElseHelp 2022-02-11 15:01:02 -06:00
Ed Page
06d43a02da fix(help): Subcommand help looks like --help
Like was said in #2435, this is what people would expect.

While we should note this in a compatibility section in the changelog, I
do not consider this a breaking change since we should be free to adjust
the help output as needed.  We are cautious when people might build up
their own content around it (like #3312) but apps should already handle
this with `--help` so this shouldn't be a major change.

We aren't offering a way for people to disable this, assuming people
won't need to.  Longer term, we are looking at support "Actions" (#3405)
and expect those to help customize the flags.  We'll need something
similar for the `help` subcommand.

Fixes #3440
2022-02-11 12:47:34 -06:00
Ed Page
272f840178 feat: Replace core set of AppSettings with functions
This is a part of #2717

Some settings didn't get getters because
- They are transient parse settings (e.g. ignore errors)
- They get propagated to args and should be checked there

`is_allow_hyphen_values_set` is a curious case.  In some cases, we only
check the app and not an arg.  This seems suspicious.
2022-02-11 12:35:09 -06:00
Ed Page
f00f97c8c4 docs(examples): Add missing feature flag reqs 2022-02-11 07:07:03 -06:00
Ed Page
47d76742eb feat: Add Arg getters for all settings
This is prep for #2717
2022-02-10 10:18:41 -06:00
josh rotenberg
ee3eab1614 docs(tutorial): Demonstrate custom parsing
Adds a more in depth validator to validate that the port is in range in the derive and builder tutorial (section 4.2).

This supersedes #3416
2022-02-09 09:16:57 -06:00
Ed Page
06b6714a48 docs(contrib): Call out parallel tutorials 2022-02-08 07:08:14 -06:00
Ed Page
5290f82133 feat: Override DeriveDisplayOrder behavior with App::next_display_order
For the derive API, you can only call `next_display_order` when dealing
with a flatten.  Until we offer app attributes on arguments, the user can workaround with
this no-op flattens.

This is a part of #1807
2022-02-07 19:19:11 -06:00
Ed Page
c00f71ec4a feat: Add App::next_help_heading
This clarifies the intent and prepares for other functions doing the
same, like `next_display_order`.  This will then open us to name
`subcommand_help_heading` and `display_order` similar.

The deprecation is waiting on 3.1.

This is part of #1807 and #1553.
2022-02-07 19:19:01 -06:00
Ed Page
0dfdeb07bc test: Update 2022-02-07 13:28:48 -06:00
Ed Page
d318752cac docs(derive): Expand on parse attribute 2022-02-02 10:37:47 -06:00
mikehoyle
50b3d2966e
Correct README syntax for bool flag (#3346)
The proper syntax for the attribute is "parse" not "parser".
2022-01-26 08:41:09 -06:00
Ed Page
f32d640d49 docs(tutorial): Talk about required/optional subcommands
Inspired by https://github.com/clap-rs/clap/discussions/3342

Looks like we already cover this in the derive reference.
2022-01-25 09:39:14 -06:00
omjadas
86c83d296f
feat: Add default_value_os_t (#3333)
The order of suffixes allows us to preserve the original builder function name.

This is a part of #2813
2022-01-24 15:32:21 -06:00
Ed Page
ddad3a7923 docs(derive): Clarify from_flag's interactions 2022-01-20 09:55:13 -06:00
Ed Page
63a36673e1 docs(derive): Link ref to tutorial / examples 2022-01-11 14:27:39 -06:00
Ed Page
6b3248fff1 docs(derive): Link tutorial to reference 2022-01-11 14:22:54 -06:00
Ed Page
4b51b8e253 docs(examples): Steer people to know about about vs long_about
`#[clap(about)]` only overrides `about`.  If the doc comment also sets
`long_about`, it won't be overridden.  This change is to help raise
visibility of reseting `long_about` in these cases.
2022-01-10 18:47:24 -06:00
Ed Page
64d16bbc03 docs(derive): Clarify which Cargo.toml field is read 2022-01-10 18:32:32 -06:00
Ed Page
c5ace9aaa6 docs(derive): Clarify what can be used with flatten 2022-01-10 08:03:59 -06:00
Ed Page
fe56bb112d doc(derive): Clarify need to do long_about = None 2022-01-10 07:25:54 -06:00
Hugo Osvaldo Barrera
7110401595 docs: Fix messed up highlighting
This just affects how it's rendered; rather than attempting to highlight
these blocks as a shell script, they'll get highlighted as console
output.

See the rendered versions for a better comparison.
2022-01-05 11:53:06 -06:00
Daniel Eades
2986a9eee0 style: remove unnecessary lazy evaluations 2022-01-04 09:20:17 -06:00
Ed Page
b0cb2057ea docs(derive): Include name magic attribute
Inspired by #3242l
2022-01-03 06:33:53 -06:00
Ed Page
3bb33387af docs(derive): Remove redundant setting 2022-01-01 19:51:17 -06:00
Ed Page
f596bb3ce8 docs(tutorial): Fix another internal link 2021-12-29 18:07:11 -06:00
Emiel Van Severen
657f32a59b
Fix broken internal link 2021-12-30 01:00:29 +01:00
迷渡
9faec11b84
docs: Fix link to 'Configuring the Parser'
Signed-off-by: 迷渡 <justjavac@gmail.com>
2021-12-24 12:41:09 +08:00
Ed Page
3db09f4dd4 fix: Don't panic on lack of conflicts
Fixes #3197
2021-12-23 13:38:23 -06:00
Ed Page
a37f2908c8 docs(derive): Looks like optional isnt supported
According to #2587
2021-12-23 10:29:34 -06:00
Ed Page
653617d0fd docs(derive): Add flatten/subcommand for variants 2021-12-23 10:27:07 -06:00
Ed Page
5643dddf3e docs(tutorial): Encourage App::debug_assert 2021-12-23 08:41:52 -06:00
Ed Page
efca08341a docs(tutorial): Fix derive anchor links 2021-12-23 08:23:32 -06:00
迷渡
c60d5dd1f0
docs: Fix anchor links 2021-12-23 10:58:14 +08:00
Ed Page
8924dd7a1e feat(derive): Don't require Display for default ArgEnum
While I'm unsure how much type specialization we should do, we
intentionally have the `arg_enum` attribute for doing special behavior
based on it, so let's take advantage of it.

Fixes #3185
2021-12-16 09:11:32 -06:00
Ed Page
aa270f6aca docs(examples): Add cargo subcommand example 2021-12-15 12:07:29 -06:00
Ed Page
03cb509d6c refactor(examples): Change naming style
This is to make room for a reasonable looking cargo plugin example.

I got lazy and didn't update the tutorials.
2021-12-15 11:12:18 -06:00
Ed Page
9e64387ef0 revert(help): Partial revert of 3c049b4
The extra whitespace was targeted at machine processing for a subset of
users for a subset of runs of CLIs.  On the other hand, there is a lot
of concern over the extra verbose output.

A user can set the help template for man, if desired.  They can even do
something (env? feature flag?) to make it only run when doing man
generation.  We also have #3174 in the works.

So let's focus on the end-user reading `--help`.  People wanting to use
`help2man` have workarounds to do what they need.

Fixes #3096
2021-12-15 10:36:59 -06:00
Ed Page
b0f1750e81
Merge pull request #3041 from fishface60/master
Rewrite Multicall handling to just strip path off argv0
2021-12-13 09:21:59 -06:00
p4tr1ck
f3afcee855 examples: Fix typo 2021-12-13 22:34:08 +08:00
DerZade
7c60180e24 docs: Fix copy paste error in example 2021-12-13 11:41:12 +01:00
Richard Maw
38b9645bed fix: Windows Multicall support
The executable suffix is unconditionally stripped off the file path
so that the file name matches subcommands names
without having to add the EXE suffix on different platforms.
2021-12-12 22:08:25 +00:00
Richard Maw
17c64ef42b fix: Example typo 2021-12-12 22:08:25 +00:00
Richard Maw
e3d355fa85 feat: Make Multicall just strip dir from argv0 2021-12-12 22:08:25 +00:00
Hiroaki ITO
c2dc425784
docs: Fix the pacman-like interface example link 2021-12-11 22:22:09 +09:00
Ed Page
cf93d7c75a docs: Fix example output
How did #3112 get merged?
2021-12-09 10:26:01 -06:00
Ed Page
7731ca2d21 docs(derive): Show how to override special types
Fixes #3107
2021-12-09 09:32:33 -06:00
Ed Page
367879ac2a docs: Fix reference to feature flags 2021-12-08 19:25:48 -06:00
Ed Page
32b5520ff1 docs: Call out features used in root examples
mitsuhiko immediately jumped into the examples and got tripped up by the
lack of documentation on feature flags needed.

I limited this to just the root ones because the rest are in a more
proper tutorial that steps through it all.
2021-12-08 16:46:49 -06:00
Pavan Kumar Sunkara
6ae804d084
Merge pull request #3082 from epage/fixes
Misc fixes from clapng fork review
2021-12-08 04:08:49 +00:00
Ed Page
76828fada8 docs: Guide people to missing_docs lint 2021-12-07 21:22:12 -06:00
Ed Page
8708c54e5a
Merge pull request #3081 from clap-rs/pksunkara-patch-1
docs: Link correct example
2021-12-07 21:11:07 -06:00
Pavan Kumar Sunkara
c98d8aac13
docs: Link correct example 2021-12-08 01:27:18 +00:00
Ed Page
c99adcc6c9 docs: Add key-value derive example
This is carried over from the clap_derive examples.  Looking over the
other examples, I feel like they are covered by other examples or by the
derive reference.  We should call out deny missing docs though.
2021-12-07 19:01:55 -06:00
Ed Page
55186f5aa3 docs: Highlight subxcommand help heading 2021-12-07 17:45:57 -06:00
Ed Page
92750c6aa5 docs: Simplify demo 2021-12-07 17:45:57 -06:00
Ed Page
6da9277522 docs(derive): Note Option Vec behavior 2021-12-07 17:45:57 -06:00
Ed Page
b2836c07a7 fix: Gracefully handle empty authors 2021-12-06 11:30:26 -06:00
Ed Page
f517c0ede1 docs: Remove author fields 2021-12-06 11:24:23 -06:00
Ed Page
27acb95cd9 docs: Add Derive API reference
I took more inspiration for organization from `serde.rs` than `docs.rs/structopt`.
2021-12-01 21:23:06 -06:00
Ed Page
7f8b1990bb docs: Iterate on examples from writing ref docs 2021-12-01 14:30:51 -06:00
Ed Page
befee6667b docs: Re-work examples
This creates distinct tutorial examples from complex feature examples
(more how-tos).  Both sets are getting builder / derive versions (at
least the critical ones).
2021-11-30 21:33:52 -06:00
Ed Page
c59598479e Revert "docs(examples): De-duplicate subcommand examples"
This reverts commit bbe32b2667.
2021-11-30 14:56:32 -06:00
Ed Page
267de95bee fix: Change app_from_crate default separator
`":"` isn't ideal, so let's make it at least `"," `.

BREAKING CHANGE: Changed `app_from_crate!()` to use `", "` separator for
authors.
2021-11-30 14:56:17 -06:00
Ed Page
f890bfa93b docs: Focus top-level README 2021-11-30 09:53:25 -06:00
Ed Page
9c4194a5a1 test: Verify examples based on feature flags 2021-11-23 17:10:01 -06:00
Ed Page
bfa02fd418 test: More thoroughly test examples
This ports our example testing over to [trycmd](https://docs.rs/) so
we can:
- More thoroughly test our examples
- Provide always-up-to-date example usage

The old way of testing automatically picked up examples.  This new way
requires we have a `.md` file that uses the example in some way.

Notes:
- Moved overall example description to the `.md` file
- I added cross-linking between related examples
- `14_groups` had a redundant paragraph (twice talked about "one and
  only one"
2021-11-23 13:13:41 -06:00
Ed Page
4c4a2b86a0 refactor: Port over to arg! 2021-11-23 09:37:14 -06:00
Ed Page
6ce9714e2b fix: Deprecate YAML API
Fixes #9
2021-11-22 16:17:46 -06:00
Ed Page
88fff13e71 Revert rename of from_yaml / from_usage
Since usage parser and yaml are on the way to being deprecated (#8, #9),
doing a rename also seems excessive, so rolling it back.

Past relevant PRs:
- clap-rs/clap#1157
- clap-rs/clap#1257
2021-11-22 16:17:46 -06:00
Ed Page
7e899cd340 Revert "Deprecate Arg::help in favour of Arg::about"
This reverts commits 24cb8b1..d0abb37 from clap-rs/clap#1840

This is part of #16.  clap-rs/clap#1840 wasn't the right call but we
don't have time to make the decision now, so instead of having one
option and changing it in 4.0, this reverts back to clap2 behavior.
2021-11-18 12:25:49 -06:00
Ed Page
bbe32b2667 docs(examples): De-duplicate subcommand examples
Not seeing what this example adds over the other ones.  We've already
shown subcommands and shown that `App` has extra behavior for when
definint subcommands.
2021-11-17 15:23:31 -06:00
Ed Page
2ac2fc6005 docs(examples): Be explicit in multicall for what clap does
This better matches our other examples
2021-11-17 15:23:31 -06:00
Ed Page
3be8bcf756 docs(examples): Move unwrap comments to expect statements
This better models what users should be doing and makes it so all
comments are more clear.  In a prior commit, when a changed an `exit` to
`unwrap`, I disliked the fact that I was mixing an unwrap explanatory
comment in with another comment.  This makes them stand apart.
2021-11-17 15:23:31 -06:00
Ed Page
41d3b8f164 docs(examples): Remove unnecessary error check
Rather not confuse the point for users.
2021-11-17 15:23:31 -06:00
Ed Page
7763a7c52a docs(examples): Focus subcommands on main call
The subcommand examples focus on the various ways of looking up
subcommands except for the main one people should be using.   This has
previously caused confusion, see https://github.com/clap-rs/clap/discussions/3000

To keep the examples focused, I only show `ArgMatches::subcommand`.  I
figure the examples are not exhaustive and that for the cases when
someone wants to do something more specialized, they can pull up the
API reference.
2021-11-17 15:23:31 -06:00
Ed Page
93948cc724 docs(examples): Work around non-commutative conflicts
The comments in these examples say that a `conflicts_with` should
override `required`.  This seems to be true one way but not the other,
causing these examples to error out at runtime.
2021-11-17 15:23:31 -06:00
Ed Page
4eba65bfaf docs(examples): Don't use is_present with subcommands
Apparently, this isn't supported anymore.
2021-11-17 15:23:31 -06:00
Ed Page
1f0d86a407 docs(examples): Highlight possible-values in help
Instead of showing the user how to do things manually, let's make the
contrast in `--help` more obvious by not manually listing the possible
values.
2021-11-17 15:23:31 -06:00
Ed Page
6fc9c7cff4 docs(examples): Be consistent in define and read order
This threw me off because the arguments are so similar, I kept relying
on the order but they were swapped.
2021-11-17 15:23:31 -06:00
Ed Page
cdc5026410 docs(examples): Use correct arg keys 2021-11-17 15:23:31 -06:00
Ed Page
7c24e937f8 docs(examples): Provide visual indication of user choice 2021-11-17 15:23:31 -06:00
Ed Page
74d41b6f52 docs(examples): Don't crash when subcommand isn't provided 2021-11-17 15:23:31 -06:00
Ed Page
0a4a2dd36b docs(examples): Provide app_from_crate! example
This consolidates two `crate_*!` macro examples into a `app_from_crate`
example.

- This is more of what we expect users to use
- We've talked about splitting the `crate_*` macros out into their own
  crate.  This shifts the focus to what clap would be providing long
  term
2021-11-17 15:23:31 -06:00
Ed Page
535d663dfc docs(examples): Align quick_examples
`01b` doesn't require `output`, so updating `01a` to match
2021-11-17 15:23:31 -06:00
Ed Page
2df043655f docs(examples): Remove reference to non-existent example 2021-11-17 15:23:31 -06:00
Ed Page
7a59dc3da4 Revert "Automatically read license field from Cargo.toml"
This reverts commit 6898fbde33.

PR #2144 added the `license` field but no consumer has been added since
the (like Issue #1768).  Since this is not ready yet, I am pulling it
from the 3.0 release.

So far, our main route for pulling a feature from the release has
been to put it behind a `unstable-*` feature flag and to create a
stablization tracking issue.  I chose to instead remove the feature
because a write-only field with no effect does not provide values for
people to use in as an early access and so doesn't outweight the cost of
the extra documentation noise and code noise it creates.  Additionally,
keeping an `unstable-` feature around when it has such an unknown path
(and time table) to stalbization feels like it violates YAGNI.  I'm
uncertain how much of this feature we can implement and not create a
legal trap for users because the crate's license is insufficient for the
final artifact's license.  I feel our stabliazation process sshould be
about iteration and collecting user feedback which this doesn't line up
with.

When someone is ready to tackle #1768, it will be easy to revert this
commit and pick up the work again.

Fixes #3001
2021-11-12 09:55:37 -06:00
rhysd
012f318c97 feat(doc): Fix many typos in docs, comments and codes found by typos-cli 2021-10-19 10:38:22 +09:00
bors[bot]
b835ce9061
Merge #2817
2817: Add support for Multicall executables as subcommands with a Multicall setting r=pksunkara a=fishface60



Co-authored-by: Richard Maw <richard.maw@gmail.com>
2021-10-16 00:32:52 +00:00