Commit graph

8 commits

Author SHA1 Message Date
Ed Page
61c9e6265b fix(help)!: Merge OPTIONS / FLAGS default groups
For those that want the original behavior, you can usxe
`arg.help_heading(Some("FLAGS"))` on your flags.  Limitations:
- This will not give you a special sort order
- This will not get a `[FLAGS]` added to usage

For templates, we removed `{unified}` and `{flags}`.  To help people
catch these, a debug_assert was added.

I'm unsure but I think there might be a change in behavior in calcuating
when to show `[OPTION]` in usage.  The old code only looked at
`required` while flags looked only at arg groups.  We now look at both.

Ideally we'd add these in `_build` and remove special casing for
no-groups except in the sort order of groups.  I feel like thats best
left for later.

This also reduced the scope of `App`s public API.
`get_*_with_no_heading` seemed a bit specialized to be in the public
API.  #2853 looks at splitting it out into its own PR.

BREAKING CHANGE: Multiple
- `UnifiedHelpMessage` removed
- `{flags}` and `{unified}` are removed and will assert when present.
- `get_*_with_no_heading` removed

Fixes #2807
2021-10-13 11:42:10 -05:00
Morley, Jonathan
1d3a292d6b assert on leading and trailing whitespace 2021-09-24 12:38:15 -04:00
patrick-gu
a4dc72ed19 Replace "Prints" with "Print" for default help and version commands 2021-07-29 20:23:25 -07:00
Logan SQUIREL
3c049b4e22
Fix compatibility with help2man output (see #1432)
Change default help template:
- The new template introduce new lines before and after
author/about sections.
- Add help template placeholders:
    - about-section
    - author-section
- Documentation of new placeholders in clap::App::help_template
- Update all unit tests by incorporating new lines
2021-02-27 16:20:52 +01:00
knidarkness
530b179776 fix: detect if space should be added before spec_vals 2020-08-25 10:41:08 +03:00
CreepySkeleton
6169bb8e79 Fix buggy tests 2020-08-12 06:12:44 +03:00
Pavan Kumar Sunkara
7bc282dd4e Rename with_name to new for Arg & ArgGroup 2020-05-14 22:50:56 +02:00
ConnorSkees
59f3e9414b allow short aliases on Arg
this implements Arg::short_alias, Arg::short_aliases,
Arg::short_visible_alias, and Arg::short_visible_aliases in addition to
adding their associated tests
2020-05-11 11:21:01 -04:00