Commit graph

204 commits

Author SHA1 Message Date
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