Commit graph

411 commits

Author SHA1 Message Date
Ed Page
6f78e2a3ff docs: Highlight notes/warnings in a block 2024-11-08 11:07:48 -06:00
Ed Page
631e54bc71 docs(cookbook): Style cargo plugin
Inspired by part of the conversation at #3234
2024-08-08 10:31:27 -05:00
Ed Page
800d7cb8ad chore: Update from template 2024-05-14 12:27:02 -05:00
Joe
2fae8fe4c9
Pretty sure that apostrophe does not belong 2024-04-22 12:20:23 -05:00
zippy-dice
62a5af66eb docs(example): Update builder examples to keep in sync with derive examples 2024-04-16 02:20:41 +09:00
zippy-dice
d9081f3dce docs(exmaples): Fix example to better align with intended use case 2024-04-16 02:11:09 +09:00
zippy-dice
a9ccb3edb5 docs(exmaples): Drop syntax variants. 2024-04-16 00:49:59 +09:00
zippy-dice
f3de5079d6 docs(examples): Add examples of same names multiple options. 2024-04-15 23:04:52 +09:00
Eric R
fcab81aadb fix: Format chained method 2024-01-23 22:29:19 -05:00
Eric R
3216a64bea fix: Format to repl.rs structure, remove readme 2024-01-23 22:27:19 -05:00
Eric R
1b28cf818a fix: Remove comma from end of EchoArgs 2024-01-23 17:38:54 -05:00
Eric R
a6391ae9e3 docs(example): Added repl derive example 2024-01-23 17:35:15 -05:00
Ed Page
64ae186dfc docs(tutorial): Don't cover 'author' as its not shown 2024-01-17 08:06:56 -06:00
Ed Page
02f82146ad docs(cookbook): Clarify intent of fake flags 2024-01-08 10:14:37 -06:00
Ed Page
3eaf1af052 fix(help): Correctly show help for fake flags 2024-01-08 09:58:42 -06:00
Ed Page
d63106b9f6 docs(cookbook): Allow repeated operators 2024-01-08 09:50:40 -06:00
Ed Page
d53d881e33 docs(cookbook): Demonstrate bad 'find' behavior 2024-01-08 09:48:34 -06:00
Ed Page
22130e3057 fix(help): Use right about when flattening
Fixes #5226
2023-11-27 09:28:30 -06:00
Ed Page
66d2bcbdd4 feat(help): Allow flattening help 2023-11-09 15:32:57 -06:00
Ed Page
caf5cdcfa0 feat(help): Allow flattening usage 2023-11-09 13:31:22 -06:00
Ed Page
a1fd922bda feat(help): Allow controlling flattening 2023-11-09 13:31:11 -06:00
devinherron
4dff87386a
fix(doc): Fix typo in 03_04_subcommands.md 2023-09-13 20:56:05 -07:00
Ed Page
9e7404b599 docs(tutorial): Attempt to clarify attributes 2023-09-11 20:50:12 -05:00
Ed Page
55923ca947 docs(cookbook): Correct a typo 2023-07-21 10:54:08 -05:00
Yuri Astrakhan
d0302c5556 chore: Inline simple non-mixed format args 2023-05-04 15:58:04 -04:00
Ed Page
234d5f91d1 fix(error): Change from neutral 'note' to helpful 'tip'
This also has the advantage of aligning with `error:`

This is a small part of #4638
2023-03-27 20:45:11 -05:00
Kurtis Nusbaum
5430df7a0f feat(derive): Support #[group] attributes
This adds the ability derive additional options for the group creation.

Fixes #4574
2023-03-25 03:25:38 -05:00
Ed Page
953e2dcd34 docs: Remove remaining references to clap attribute 2023-02-18 18:42:07 -06:00
graves501
ad6778d206
Fix typo in git.rs 2023-02-07 23:13:52 +01:00
Ed Page
3f2625fc5e docs(examples): Differentiate struct from command name
This supersedes #4692
2023-02-06 10:25:14 -06:00
Martin
704d0e7a4f chore: Make format!() calls more readable 2023-01-29 19:14:47 +00:00
Ed Page
9d1de20787 docs: Prefer get_flag over get_one::<bool>
Inspired by #4654
2023-01-23 09:23:38 -06:00
Ed Page
162a556dba fix(error): Try to soften unexpected argument/value errors
Adding "found" might seem minor but I feel it has a slight softening on the message.  It also maintains scanability as it is at the end and short.

As this is a one-off message change and not a styling issue to be consistent with, I think this is safe to put in a patch release.
2023-01-13 21:29:49 -06:00
Ed Page
762b06fba4 fix(error): Try to polish/clarify messages
In text communication you need to balance
- Scannability, putting the most important information upfront
- Brevity so people don't get lost in the message
- Softness to help ease people through a frustrating experience

I feel we weren't doing great on the first two points, so tried to
iterate on the messages to improve them.  I hope we aren't suffering too
much on the third point as a side effect.
2023-01-06 17:01:36 -06:00
Ed Page
68a7740fdc fix(error): Match rustc for giving more information 2023-01-03 13:22:35 -06:00
Ed Page
c2efb60a5f fix(error): Lowercase the start of error messages
This matches the rustc error style
2023-01-03 13:17:46 -06:00
Ed Page
e7d58b3daf
Merge pull request #4385 from epage/errors
fix(error): Be consistent with rustc diagnostic guidelines
2023-01-03 12:54:16 -06:00
Ed Page
36bc641648 fix(help): Remove extraneous text from built-ins
This is an intermediate solution for #4408.  As there were no agreeed
upon goals, I went with what I felt read well and that I saw commonly
used on non-clap commands.

- "information" isn't really a necessary word.
- I originally favored `Print this help` but realied that doesn't read
  correctly in completions.
- Besides being shorter, the reason for the flipped short/long hint is
  it gives people the context they need for scanning, emphasizing
  "summary" and "more".

Fixes #4409
2023-01-03 11:02:26 -06:00
Ed Page
dde22e74ca style: Update for latest clippy 2022-12-22 12:25:33 -06:00
Sergej Pershaj
3250bcec4c docs: Provide a better example for positional arg append under derive 2022-10-14 14:49:39 +01:00
Sergej Pershaj
e6436a0967 docs: Provide a better example for positional arg append 2022-10-14 12:54:38 +01:00
Ed Page
f1ffc63a79 fix(error): Be consistent with rustc diagnostic guidelines
From
https://rustc-dev-guide.rust-lang.org/diagnostics.html#suggestion-style-guide

> Suggestions should not be a question. In particular, language like
> "did you mean" should be avoided. Sometimes, it's unclear why a
> particular suggestion is being made. In these cases, it's better to be
> upfront about what the suggestion is.
>
> The message may contain further instruction such as "to do xyz, use"
> or "to do xyz, use abc".

Inspired by #2766
2022-10-13 14:01:49 -05:00
Ed Page
1039c61c53 fix(error): Be more consistent in error quoting 2022-10-13 10:45:38 -05:00
Ed Page
f8053fcedb fix(error): Don't suggest '--' when it doesn't help 2022-10-13 10:17:11 -05:00
Ed Page
e467cc70ae docs(cookbook): PossibleValues with custom types
This used to be more magical in clap 3 and people are having a hard time
discovering how to get this in clap 4, so let's add examples:
- discrete numbers
- foreign enums
2022-10-05 19:12:05 -05:00
mattmadeofpasta
e644a5ef66
docs(builder): Add help text 2022-10-04 16:26:57 -04:00
mattmadeofpasta
b1c05bcecb
docs(derive): Add help text 2022-10-04 16:24:35 -04:00
Gilbert Gilb's
39cf3e7124
doc(fix typo): add missing "l" in "toml" 2022-10-01 20:36:01 +02:00
Ed Page
6615003c46 docs(cookbook): Provide example of --color[=WHEN] 2022-09-30 20:33:36 -05:00
KuuWang
71be5463e5
doc(fix typo): no close bracket in example
Tutorials (derive, builder > Tutorials (derive, builder)
2022-09-30 17:43:23 +09:00