Commit graph

5299 commits

Author SHA1 Message Date
Jan Verbeek
6d558c9141 perf: Do not inline get_color()
Saves 1.7K.
2022-02-01 17:21:40 +01:00
Jan Verbeek
3258396738 perf: Do not do verb formatting at runtime
Saves 1K.
2022-02-01 17:21:40 +01:00
Jan Verbeek
0c0d51b29a perf: De-inline another formatting method 2022-02-01 17:21:40 +01:00
Jan Verbeek
82dd01a1df style: Change unwrap_or_else() → or() 2022-02-01 17:21:35 +01:00
Ed Page
96dbbad785
Merge pull request #3376 from MForster/update-readme
Update README.md to match example code
2022-02-01 06:58:50 -06:00
Ed Page
7f812618a6
Merge pull request #3375 from rfdonnelly/fix-bool-parsing-link
Update link to explicit bool parser example
2022-02-01 06:58:24 -06:00
Ed Page
a22ef919c4
Merge pull request #3374 from rfdonnelly/fix-faq-toc
Fix FAQ table of contents
2022-02-01 06:57:39 -06:00
Ed Page
23fd8d3e26
Merge pull request #3377 from clap-rs/dependabot/cargo/trycmd-0.12
chore(deps): update trycmd requirement from 0.9 to 0.12
2022-02-01 06:56:40 -06:00
dependabot[bot]
55ac69827b
chore(deps): update trycmd requirement from 0.9 to 0.12
Updates the requirements on [trycmd](https://github.com/assert-rs/trycmd) to permit the latest version.
- [Release notes](https://github.com/assert-rs/trycmd/releases)
- [Changelog](https://github.com/assert-rs/trycmd/blob/main/CHANGELOG.md)
- [Commits](https://github.com/assert-rs/trycmd/compare/v0.9.0...v0.12.2)

---
updated-dependencies:
- dependency-name: trycmd
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 07:04:59 +00:00
Michael Forster
d81110b5c5 docs: Update README.md to match example code 2022-02-01 07:35:16 +01:00
Rob Donnelly
c8bb8def57 docs(faq): Fix table of contents
* Remove entries for sections that no longer exist
* Update entry for "How many approaches"
* Renumber entries
2022-01-31 22:01:34 -08:00
Rob Donnelly
a19bca8a10 docs(error): Update link to explicit bool parser example 2022-01-31 21:58:54 -08:00
Jan Verbeek
29191bf386 perf: Remove another BTreeMap
This is smaller if we do a stable sort.
2022-02-01 00:02:44 +01:00
Jan Verbeek
844e0cde91 perf: Improve display_arg_val() code size
Making it non-generic doesn't seem to help.
2022-02-01 00:02:44 +01:00
Ed Page
38e7ec5c33
Merge pull request #3372 from NeuralNetwork/master
added missing 'be'
2022-01-31 10:24:36 -06:00
Jan-Bernd Vosteen
c78494fd75 added missing 'be' 2022-01-31 14:52:36 +01:00
Ed Page
572e9dc7c4
Merge pull request #3371 from Wilfred/patch-1
Fix typo in doc comment
2022-01-29 18:45:43 -06:00
Wilfred Hughes
f7a2b472a2
Fix typo in doc comment 2022-01-29 16:18:33 -08:00
Ed Page
66d7d503af
Merge pull request #3370 from blyxxyz/size
Optimize code size
2022-01-29 17:33:44 -06:00
Jan Verbeek
a18658af86 perf: Replace BTreeMaps by manually sorted Vecs
This removes another ~20KB of code size.

There is one BTreeMap left, but replacing that one doesn't make a difference.
2022-01-29 22:18:32 +01:00
Jan Verbeek
7bf2479125 perf: Do not inline formatting methods
This shaves off ~20KB from the argparse-benchmarks-rs app.
2022-01-29 22:18:30 +01:00
Ed Page
f443eacdab
Merge pull request #3366 from epage/man
fix(man)!: Clean up Meta API
2022-01-28 17:53:36 -06:00
Ed Page
b16cfeecdc fix(man): Expose title generation 2022-01-28 16:22:53 -06:00
Ed Page
2fdb9a3d54 fix(man)!: Clean up Meta API
`Meta` wasn't really serving a distinct purpose in the API, so rolled it
into `Man` now that it lazily renders.
2022-01-28 16:21:14 -06:00
Ed Page
1e2bafe78c
Merge pull request #3364 from epage/man
feat(man)!: Allow customizing man page
2022-01-28 16:13:02 -06:00
Ed Page
5d0ef1f420 feat(man): Allow customizing man page
This is part of #3354
2022-01-28 15:59:09 -06:00
Ed Page
6453df1dc1 refactor(man)!: Open door for customizing rendering
BREAKING CHANGE: Functions now take ownership
2022-01-28 15:42:46 -06:00
Ed Page
924262b329
Merge pull request #3356 from epage/man
docs: Add man changelog
2022-01-28 15:34:05 -06:00
Ed Page
f3f63a4f19 docs: Add man changelog 2022-01-28 15:15:14 -06:00
Sondre Nilsen
0b045f5d0d
feat(man): Initial man generator (#3174)
This is an initial implementation with plenty of room to grow, including
- Allowing pulling out a subset of the generated man page for greater customization
- Subcommand handling
- Extra sections
- Consolidate argument formatter after #2914

Fixes #552
2022-01-28 14:55:55 -06:00
Ed Page
d2109b3969 chore: Release 2022-01-26 15:54:12 -06:00
Ed Page
7f1860e7e2 chore: Update release process 2022-01-26 15:54:06 -06:00
Ed Page
f5ae5714bc docs: Update changelog 2022-01-26 15:53:25 -06:00
Ed Page
993d55fcf3
Merge pull request #3347 from jpgrayson/master
fix(help): Optional arg values in brackets
2022-01-26 15:52:13 -06:00
Peter Grayson
7eea7d27ad
fix(help): Optional arg values in brackets
When an Arg uses .min_values(0), that arg's value(s) are effectively
optional. This is conventionaly denoted in help messages by wrapping the
arg's values in square brackets. For example:

    --foo[=value]
    --bar [value]

This kind of argument can be seen in the wild in many git commands; e.g.
git-status(1).

Signed-off-by: Peter Grayson <pete@jpgrayson.net>
2022-01-26 12:03:23 -05: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
Samuel El-Borai
5ccffb073b
docs: Fix builder link from docs.rs #3345
3468325b8d and afd0342a added extra context to the README's example.  However, when browsing it at docs.rs, the builder link just links back to the page you are own, offering little value.

Instead we'll now link to the tutorial which works as a next step from the example and resolves the "what do we link for the builder api" question.
2022-01-25 13:30:13 -06:00
Ed Page
b88faadcb9
Merge pull request #3343 from epage/sub
docs(tutorial): Talk about required/optional subcommands
2022-01-25 09:56:53 -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
ea7699c11f chore: Release 2022-01-24 15:34:27 -06:00
Ed Page
d09188a7ce docs: Update changelog 2022-01-24 15:33:12 -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
e5b06c3061 chore: Release 2022-01-24 10:54:50 -06:00
Ed Page
ac43b7baee docs: Update changelog 2022-01-24 10:54:04 -06:00
Ed Page
af5502461c
Merge pull request #3334 from epage/source
fix(parser): Track the most explicit value source
2022-01-24 10:51:25 -06:00
Ed Page
c6664afe9d fix(parser): Track the most explicit value source
We were only tracking the last value source (default, env, cli, etc).
This works for args because they only come from one source.  Groups
however can come from multiple sources and this was making us treat a
group with a default value as being completely from defaults despite
some values maybe being from the commandline.

We now track the highest precedence value for a group.

Fixes #3330
2022-01-24 10:34:41 -06:00
Ed Page
afd0342a9b docs(readme): discuss API trade offs
Fixes #3329
2022-01-24 08:29:02 -06:00
Ed Page
43673a1bd1 docs(error): Update reported failure code
Fixes #3332
2022-01-24 08:11:18 -06:00
Ed Page
a7f33efd80 docs(faq): Note clap-serde 2022-01-21 09:49:01 -06:00
Ed Page
0dd169be52
Merge pull request #3328 from epage/panic
Clarify some panics
2022-01-21 08:51:16 -06:00