Commit graph

40 commits

Author SHA1 Message Date
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
dbe8c0c957 docs(tutorial): Prefer custom parsing to validation 2022-03-14 09:31:40 -05:00
Jörg Wunderlich-Pfeiffer
92e1666868 docs: Fix link to example 2022-03-06 11:05:23 +01:00
Steve Klabnik
f89c8f4da2 Fix a typo in an example 2022-03-02 08:41:08 -06:00
Ed Page
cb9cb251a9 style: Clean up 2022-02-22 17:47:46 -06:00
Ed Page
c55989459f docs(tutorial): Examples as next step 2022-02-22 08:37:13 -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
97e36451cf docs: Update stale references to AppSettings 2022-02-11 15:58:12 -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
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
0dfdeb07bc test: Update 2022-02-07 13:28:48 -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
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
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
3bb33387af docs(derive): Remove redundant setting 2022-01-01 19:51:17 -06:00
Emiel Van Severen
657f32a59b
Fix broken internal link 2021-12-30 01:00:29 +01:00
Ed Page
3db09f4dd4 fix: Don't panic on lack of conflicts
Fixes #3197
2021-12-23 13:38:23 -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
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
Pavan Kumar Sunkara
c98d8aac13
docs: Link correct example 2021-12-08 01:27:18 +00: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
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