Commit graph

5941 commits

Author SHA1 Message Date
Ed Page
88b941f87b
Merge pull request #4113 from epage/docs
docs: Fix for 1.63
2022-08-25 10:52:22 -05:00
Ed Page
4005dc40d7 docs: Fix for 1.63
This is a backport of e7ced880e
2022-08-25 10:41:50 -05:00
Ed Page
646a63674f
Merge pull request #4112 from jpgrayson/doc-override-usage-v3
docs: How to override multi-line usage
2022-08-25 10:38:50 -05:00
Peter Grayson
9620e12dd7
docs: How to override multi-line usage
Backport #4106 to v3-master branch.
2022-08-25 11:28:10 -04:00
Ed Page
df30c1a1a8 chore: Release 2022-08-12 08:28:06 -05:00
Ed Page
57161dbe92 docs: Update changelog 2022-08-12 08:26:41 -05:00
Ed Page
e29f0140a6
Merge pull request #4068 from danielparks/issue-3785-derive-id-attr-v3
v3 fix(derive): Add "id" attribute
2022-08-12 08:25:31 -05:00
Ed Page
bc84fc0f6e chore(ci): Lock docs to MSRV
This will help avoid issues with new warnings
2022-08-12 08:25:02 -05:00
Daniel Parks
d8e25498b2
fix(derive): Add "id" attribute
Backported from future version 4 (original commit
1a2ae76738)

> Previously the Arg id was set with the "name" attribute. This allows use
> of an "id" attribute to match the underlying struct.
>
> A side effect of this is that the "id" attribute may also be used on
> Commands. This isn't desired, but given the current architecture of the
> attribute parser, it's hard to avoid.
>
> Fixes: #3785
2022-08-11 21:49:41 -07:00
Ed Page
565c5ea5c0
Merge pull request #4048 from epage/backport
docs(tutorial): Switch to hand-implemented ValueEnum
2022-08-09 13:21:55 -05:00
Ed Page
3af94ec0af docs(tutorial): Switch to hand-implemented ValueEnum 2022-08-09 11:56:55 -05:00
Ed Page
3943ad7fc0 test(tutorial): Ensure we actually test code
Biggest problem identified is that we are incorrectly setting the help
usage in `04_04_custom`
2022-08-09 11:56:48 -05:00
Ed Page
a61f874a51
Merge pull request #4043 from epage/action
docs(derive): Clarify what defaulted action/value_parser does
2022-08-08 20:18:40 -05:00
Ed Page
c7123b3159 docs(derive): Clarify what defaulted action/value_parser does
Noticed this was missing when responding to #4041
2022-08-08 08:53:48 -05:00
Ed Page
f522b2c746
Merge pull request #4016 from epage/arg-enum
docs: Remove references to ArgEnum
2022-08-01 15:49:04 -05:00
Ed Page
1879ded6a9 docs: Remove references to ArgEnum
This is a partial backport of #4015

Fixes #4008
Fixes #4009
2022-08-01 15:42:31 -05:00
Ed Page
9bd1e2fd39 chore: Release 2022-07-29 20:52:02 -05:00
Ed Page
5e525944a5 docs: Update changelog 2022-07-29 20:51:50 -05:00
Ed Page
80ea08cc5a
Merge pull request #4006 from epage/error
fix(parser): Include required argument in message
2022-07-29 20:50:17 -05:00
Ed Page
4c43b21c35 fix(parser): Include required argument in message
When suggesting required arguments, we wanted to avoid an argument
showing up in both a group and by itself but we didn't correctly
calculate that, causing no required arguments to show up at times.

Now, we all use the same pool of information for doing the calculations.

This was the type of cleanup that I expected it to drop our binary size
but this added 1k to our .text.  Strange.

Fixes #4004
2022-07-29 20:21:42 -05:00
Ed Page
ef1424b21c refactor(usage): Clarify required gathering 2022-07-29 20:21:36 -05:00
Ed Page
b2a8fd7f46 chore: Release 2022-07-25 13:30:42 -05:00
Ed Page
026e858065 chore: Allow releasing from release branches 2022-07-25 13:30:17 -05:00
Ed Page
84ae6df0a1 docs: Update changelog 2022-07-25 13:29:28 -05:00
Ed Page
69b0904eda
Merge pull request #3987 from emersonford/default-values-t-v3-backport
feat(clap_derive): Add `default_values_t` and `default_values_os_t` (backport for Clap v3)
2022-07-25 13:25:10 -05:00
Emerson Ford
027a67542b feat(clap_derive): Add default_values_t and default_values_os_t
(backport to v3)
2022-07-25 10:42:46 -07:00
Ed Page
9262d924bc chore(gh): Start v3 patch maintenance 2022-07-21 12:29:14 -05:00
Ed Page
19371247fc
Merge pull request #3961 from epage/prep
chore(gh): Prepare for more branches to be added
2022-07-21 12:28:30 -05:00
Ed Page
0eeb4da33d chore(gh): Prepare for more branches to be added 2022-07-21 12:19:23 -05:00
Ed Page
d40e42a9ca chore: Release 2022-07-20 20:13:29 -05:00
Ed Page
88b9406c1b docs: Update changelog 2022-07-20 20:13:20 -05:00
Ed Page
f48e517b71
Merge pull request #3960 from epage/pos
fix(parser): low index multiples work with flags
2022-07-20 20:12:13 -05:00
Ed Page
48f087d090 fix(parser): low index multiples work with flags
We had some tests for this but not sufficient obviously.  The problem is
we were tweaking the positional argument counter when processing flags
and not just positional arguments.  Delaying it until after flags seems
to fix this.

Fixes #3959
2022-07-20 17:44:49 -05:00
Ed Page
5e02445ce5 docs: Small tweak to lib docs 2022-07-19 15:54:01 -05:00
Ed Page
318e0ab35d
Merge pull request #3955 from tshepang/patch-1
docs: reduce the need to guess
2022-07-19 15:34:44 -05:00
Tshepang Mbambo
01d7e7ac04
docs: reduce the need to guess 2022-07-19 22:32:42 +02:00
Ed Page
e6b8b4b607 chore: Release 2022-07-19 14:41:47 -05:00
Ed Page
85ccf3e901 chore: Update release process 2022-07-19 14:41:42 -05:00
Ed Page
fcd7cae81f docs: Update changelog 2022-07-19 14:39:36 -05:00
Ed Page
36ed1bdfee
Merge pull request #3952 from epage/redocs
docs: Move everything to docs.rs
2022-07-19 14:38:45 -05:00
Ed Page
a15524af08
Merge pull request #3953 from epage/msrv
chore: Allow testing MSRV
2022-07-19 14:05:02 -05:00
Ed Page
4f6ffea0ed chore: Allow testing MSRV 2022-07-19 13:50:27 -05:00
Ed Page
d43f1dbf6f docs: Move everything to docs.rs
A couple of things happened when preparing to release 3.0
- We needed derive documentation
  - I had liked how serde handled theres
  - I had bad experiences finding things in structopt's documentation
- The examples were broken and we needed tests
- The examples seemed to follow a pattern of having tutorial content and
  cookbook content
- We had been getting bug reports from people looking at master and
  thinking they were looking at what is currently released
- We had gotten feedback to keep down the number of places that
  documentation was located

From this, we went with a mix of docs.rs and github
- We kept the number of content locations at 2 rather than 3 by not
  having an external site like serde
- We rewrote the examples into explicit tutorials and cookbooks to align
  with the 4 styles of documentation
- We could test our examples by running `console` code blocks with
  trycmd
- Documentation was versioned and the README pointed to the last release

This had downsides
- The tutorials didn't have the code inlined
- Users still had a hard time finding and navigating between the
  different forms of documentation
- In practice, we were less likely to cross-link between the different
  types of documentation

Moving to docs.rs would offer a lot of benefits, even if it is only
designed for Rust-reference documentation and isn't good for Rust derive
reference documentation, tutorials, cookbooks, etc.  The big problem was
keeping the examples tested to keep maintenance costs down.  Maybe its
just me but its easy to overlook
- You can pull documentation from a file using `#[doc = "path"]`
- Repeated doc attributes get concatenated rather than first or last
  writer winning

Remember these when specifically thinking about Rust documentation made
me realize that we could get everything into docs.rs.

When doing this
- Tutorial code got brought in as was one of the aims
- We needed to split the lib documentation and the README to have all of
  the linking work.  This allowed us to specialize them according to
  their rule (user vs contributor)
- We needed to avoid users getting caught up in making a decision
  between Derive and Builder APIs so we put the focus on the derive API
  with links to the FAQ to help users decide when to use one or the
  other.
- Improved cross-referencing between different parts of the
  documentation
- Limited inline comments were added to example code
  - Introductory example code intentionally does not have teaching
    comments in it as its meant to give a flavor or sense of things and
    not meant to teach on its own.

This is a first attempt.  There will be a lot of room for further
improvement.  Current know downsides:
- Content source is more split up for the tutorials

This hopefully addresses #3189
2022-07-19 13:30:38 -05:00
Ed Page
a8a7a61f56 chore: Release 2022-07-14 09:38:54 -05:00
Ed Page
ed8837f2cc docs: Update changelog 2022-07-14 09:38:47 -05:00
Ed Page
afc540153b
Merge pull request #3902 from tmccombs/get-conflicts-with-group
Include groups in `get_arg_conflicts_with`
2022-07-14 09:37:45 -05:00
Thayne McCombs
f27f1f57ea fix: Include groups in get_arg_conflicts_with
So that it doesn't panic if trying to get the conflicts for an Arg that
conflicts with a group.

Fixes: #3900
2022-07-14 01:08:06 -06:00
Ed Page
2df0732df4 chore: Release 2022-07-13 09:08:35 -05:00
Ed Page
1c2242251b docs: Update changelog 2022-07-13 09:08:21 -05:00
Ed Page
e8374e3f2e
Merge pull request #3913 from emersonford/expose-non-visible-arg-aliases
feat: Add method to get non-visible arg aliases
2022-07-13 09:07:17 -05:00