Commit graph

2060 commits

Author SHA1 Message Date
Ed Page
e5997c1001 docs: Clarify deprecations 2021-12-08 11:14:47 -06:00
Ed Page
76828fada8 docs: Guide people to missing_docs lint 2021-12-07 21:22:12 -06:00
Ed Page
e9b19d676b
Merge pull request #3078 from epage/fixes
Misc fixes from clapng fork review
2021-12-07 21:02:39 -06:00
Ed Page
7f54ecfd0a fix: Deprecation notice for UnifiedHelpMessage,
I missed this in my previous sweeps for re-adding-but-deprecating
Settings.
2021-12-07 18:27:32 -06:00
Ed Page
093de2b83b docs: Add back in logo 2021-12-07 17:45:57 -06:00
Ed Page
e3da325b5a docs: Link out to the crate_ macros 2021-12-07 17:45:57 -06:00
Ed Page
26bbe606d3 Revert "Revert "Revert "docs: Clarify corner caseses with default values"""
This reverts commit 98f696c0a6.

This was previously missed.  See #3076
2021-12-07 17:45:57 -06:00
Ed Page
c1033a3d7a refactor: Simplify Arg::new 2021-12-07 17:45:57 -06:00
Ed Page
4a5d52350e docs: Update old repo location 2021-12-07 08:14:41 -06:00
Ed Page
b2836c07a7 fix: Gracefully handle empty authors 2021-12-06 11:30:26 -06:00
Ed Page
c23f9230d1 chore: Remove stale boiletplate 2021-12-06 11:04:41 -06:00
Ed Page
8595357542 chore: Only error for warnings in CI
This makes it easier for developers to iterate, not having to stop to
write docs just to get things building.
2021-12-06 11:03:14 -06:00
Ed Page
b46abb7236 docs: Re-order items in docs
This contains two types of re-ordering:
- Internal, putting the focus of each file first.
- Public, re-arranging items and grouping impl blocks to try to better
  organize the documentation and find related items.

The main weakness of the docs work is in `Args`.  Its just a mess.  In
particular, we should probably link the simple casesm like `required` to
the advanced impl block.

Fixes #55
2021-12-04 19:18:28 -06:00
Pavan Kumar Sunkara
cc2dddba8e Add DisableColoredHelp setting to improve flexibility (clap-rs/clap#2956)
Until we have a modular help generator that can be configured and/or
authored by the users themselves as part of #2914, we will provide the
flexibility of turning off colored help messages but still wanting
colored error messages.

This flexibility was available before #2845 and @dbrgn immediately
noticed it and requested it back to which I agree. This was also
suggested by Josh in
[here](https://github.com/clap-rs/clap/issues/2806#issuecomment-933877438)
2021-12-04 12:00:46 -06:00
Ed Page
0cd16c34fc feat: App::debug_assert test helper
This will especially be important for users migrating from clap2 so they
can catch problems earlier in the process.
2021-12-03 14:12:03 -06:00
Ed Page
500def4904 fix(derive): Smooth out transition for structopt
Adding in a `StructOpt` derive with `structopt` attributes, with
deprecation notices.  Unofrtunately, not as many deprecation warnings as
I would like.  Apparently, you can't do them for a `use` of a derive?  I
also wanted to inject code that would trigger a deprecation notice for
attributes but that would require enough of a refactor that I didn't
consider it worth it.  We are at least providing a transition window
even if it means we'll have to remvoe it next major release without a
deprecation warning.
2021-12-02 20:18:33 -06:00
Ed Page
75d417851b docs: Clean up 3.0 changelog 2021-12-02 16:07:43 -06:00
Ed Page
3f9da04744 fix: Revert as much yaml policy to v2 as possible 2021-12-02 16:06:21 -06:00
Ed Page
0294fd0170 revert: Bring back ArgSettings::Global
This is a partial revert of cacc23473.  It appears that the deprecation
of `ArgSettings::Global` was never followed through on.
2021-12-02 16:06:21 -06:00
Ed Page
c93809271c fix: Deprecate, rather than obsolete, some App functions 2021-12-02 16:06:21 -06:00
Ed Page
c8254918d6 fix: Add back arg_enum 2021-12-02 16:06:21 -06:00
Ed Page
e065d1dd79 fix: Fix deprecated function name 2021-12-02 16:06:21 -06:00
Ed Page
d876f306eb fix: Add back in write_version 2021-12-02 16:06:21 -06:00
Ed Page
0d1f34b91d fix: Finish reverting clap_app 2021-12-02 10:45:10 -06:00
Ed Page
83abb24002 fix: Remove EmptyValues
The intention had been to that people setting this would now set
nothing.  Unfortunately, clap2 had `EmptyValues` as the default, so
people were more likely to unset it, making this not work out.
2021-12-02 09:59:41 -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
181eff5541 docs: Fix stale examples
These were broken in #17 and #38 when renaming `hidden` to `hide`.  These
weren't caught because we test with `--all-targets` which is mutually
exclusive with `--doc`.
2021-11-30 12:05:30 -06:00
Ed Page
ea73ec521b
Merge pull request #44 from epage/examples
docs: Prefer `global_setting`
2021-11-29 16:40:20 -06:00
Ed Page
30f5872a71 fix: Consistent help between Args and Subcommands
`App::subcommand_placeholder` encompassed
- `Arg::value_name`
- `Arg::help_heading`

Split it and renamed it to make it more consistent.
2021-11-29 16:17:02 -06:00
Ed Page
54228ef7d7 docs: Prefer global_setting
I've been finding I've been setting `AppSettings` without it which is
likely leading to bugs.  This tries to raise the visibility by using it
based on the setting being used and not whether the application needs
it.
2021-11-29 16:10:54 -06:00
Ed Page
b8c34c3b57 fix: Detect when AllowInvalidUtf8 is needed
Fixes #36
2021-11-29 15:37:44 -06:00
Ed Page
c5f5c49766 refactor(parser): Use modern '?' 2021-11-29 14:20:25 -06:00
Ed Page
8a1099f921 refactor(parser): More context when creating a MatchedArg 2021-11-29 14:01:08 -06:00
Ed Page
211d36efad refactor(parser): Be consistent on terms 2021-11-29 14:01:02 -06:00
Ed Page
44700506eb docs: Be consistent in builder args 2021-11-29 11:21:45 -06:00
Ed Page
62d7a3a928 fix: Be consistent on hide/hidden
- `PossibleValue::hidden` -> `PossibleValue::hide` (new in clap3, no
  breakin change)

Fixes #33
2021-11-29 10:58:00 -06:00
Ed Page
57e5fc2b07 fix: Rename to Arg::ignore_case like ArgSettings
Fixes #32
2021-11-29 10:34:42 -06:00
Ed Page
8fc12586bb fix: Make AppSettings::HidePossibleValues mirror ArgSettings
Fixes #31
2021-11-29 10:28:31 -06:00
Ed Page
eae3ffb599 docs: Emphasize Arg over ArgSettings 2021-11-29 09:54:04 -06:00
Ed Page
d1eec17d03 docs: Remove references to YAML 2021-11-24 16:09:56 -06:00
Ed Page
a2f0863a30 docs: Polish reference API 2021-11-24 16:09:53 -06:00
Ed Page
314a6a36bb fix: Rename HelpRequired to HelpExpected
This both distances itself from our 'require' terminology and aligns
itself with `Option::expect`, making it more likely for people to guess
the intended behavior.
2021-11-24 11:38:57 -06:00
Ed Page
5210744d3a
Merge pull request #26 from epage/hyphen
fix: Rename App's AllowLeadingHyphen to AllowHyphenValues
2021-11-24 11:38:26 -06:00
Ed Page
c15a0bf5b3 fix: Rename App's AllowLeadingHyphen to AllowHyphenValues
This aligns us with `Arg::allow_hyphen_values` in clap2.
2021-11-24 11:25:48 -06:00
Ed Page
4b72d3cc7f feat: Color debug output 2021-11-24 11:21:40 -06:00
Ed Page
463d75474e refactor(color): Track style, rather than details
This makes it easier for us to compose.  Before, we had to infer things
like "bold" based on the color.  Now we just say "error" and get all of
the formatting specific to that.
2021-11-24 11:21:40 -06:00
Ed Page
6a580d4de2 fix: Deprecate, rather than remove, AllowLeadingHyphen 2021-11-24 10:24:18 -06:00
Ed Page
d4173bd596 docs: Clean up deprecations 2021-11-23 10:32:05 -06:00
Ed Page
3c3a0b71d1 fix: Deprecate runtime usage parser
Fixes #8
2021-11-23 09:53:04 -06:00
Ed Page
4c4a2b86a0 refactor: Port over to arg! 2021-11-23 09:37:14 -06:00