Commit graph

3934 commits

Author SHA1 Message Date
Logan SQUIREL
52e74fa305
Fix App::version/long_version test 2021-02-27 16:31:32 +01: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
Pavan Kumar Sunkara
96f1fce087 Converted the issue templates to forms 2021-02-26 00:45:53 +00:00
Pavan Kumar Sunkara
d3623114c8 Create bug_report.yml 2021-02-26 00:34:49 +00:00
Pavan Kumar Sunkara
ecdc8ed80e
Merge pull request #2363 from HeroicKatora/master
Optimize common case of space padding
2021-02-25 13:52:57 +00:00
Andreas Molzer
c6ea3720ab Optimize common case of space padding 2021-02-25 13:26:39 +01:00
Pavan Kumar Sunkara
4067707302
Merge pull request #2361 from kevgo/patch-1
Fix typo
2021-02-24 18:44:22 +00:00
Kevin Goslar
205479a2b1
Fix typo 2021-02-24 08:00:59 -06:00
Pavan Kumar Sunkara
d92592a63b
Merge pull request #2358 from logansquirel/master
Fix issue #2181
2021-02-22 16:08:06 +00:00
Pavan Kumar Sunkara
69d32bca15
Merge pull request #2359 from blyxxyz/fish-avoid-useless-subcommand-detection
fix: Do not look for subcommands in fish completion if none exist
2021-02-22 16:02:38 +00:00
Jan Verbeek
7bb2795706 fix: Do not look for subcommands in fish completion if none exist 2021-02-22 15:35:07 +01:00
Logan SQUIREL
cd8660fbd0
Fix issue #2181
- help / version flag report correct application name when generated
with clap_derive and an Enum.
- add clap_derive unit tests for application name:
  file: clap_derive/tests/app_name.rs
  tests: app_name_in_[short|long]_[help|version]_from_[struct|enum]()
2021-02-22 15:01:02 +01:00
Pavan Kumar Sunkara
90a74044ee
Merge pull request #2349 from logansquirel/master
imp: Visible aliases for arguments in completions
2021-02-22 09:09:25 +00:00
Logan SQUIREL
f74af655ce
Apply @pksunkara review 2021-02-22 09:37:29 +01:00
Logan SQUIREL
22b5d34693
imp: Visible aliases for arguments in completions (#2335)
Following changes are implemented:

- Add 'clap::Arg::get_visible_aliases(&self)' method
  This new method provides access to visible argument aliases
- Add 'clap::Arg::get_short/long_and_visible_aliases
  This new method provides access to the short/long arguments and its
  visible aliases
- Add visible aliases completions in clap_generate for following shells:
  - Bash
  - Elvish
  - Fish
  - Powershell
  - Zsh
- Add test fixtures for testing visible alias completions in clap_generate:
  'clap_generate/tests/completions/<shell>::<shell>_with_aliases()'
2021-02-22 09:36:08 +01:00
Pavan Kumar Sunkara
1602b103cd
Fix typo in crate_license docs 2021-02-20 22:08:48 +00:00
Pavan Kumar Sunkara
7a5b7b0ada
Merge pull request #2285 from mgeisler/str-width-count-chars
feat: count chars instead of bytes in str_width
2021-02-20 21:06:24 +00:00
Martin Geisler
df7a8c1282 feat: remove direct unicode-width dependency
This removes the direct dependency on unicode-width and delegates the
complexity of computing the displayed width of text to the Textwrap
crate.

The `display_width` function handles characters like “æøå” (Danish),
“äöü” (German), and “😂😍” (emojis) – even if the unicode-width
Cargo feature is disabled.

This is an improvement of the former `str_width` function which would
over-estimate the width of emojis and non-ASCII characters (since they
are several bytes wide).
2021-02-20 20:56:15 +01:00
Pavan Kumar Sunkara
80cbc1e695
Merge pull request #2350 from ldm0/num_vals
Change how num_vals, min_vals, max_vals interacts with Multiple*
2021-02-18 21:07:26 +00:00
Pavan Kumar Sunkara
0f92d5f2c3
Merge pull request #2352 from ldm0/all
Add --all-features for CI, fix build with debug feature.
2021-02-18 20:39:43 +00:00
ldm0
2d26f02605 Add --all-features for CI, fix build with debug feature. 2021-02-17 04:37:08 +00:00
ldm0
3873b647d1 Add tests for 2229 2021-02-16 03:58:58 +00:00
ldm0
28b58af63b Change to num_vals, min_vals, max_vals interacts with Multi* 2021-02-16 03:45:20 +00:00
Collin Styles
2b45011c9b
Update docs for required_unless_present_any (#2347)
* docs: Correct method name in example

This looks like it was copied from the documentation for
`required_unless_present_all` but not updated accordingly for this
method.

* docs: Add note re `required_unless_present_all` to `required_unless_present_any`

There's a note in the documentation for `required_unless_present_all`
telling users to check out `required_unless_present_any` if that's what
they want. I figured it might be useful to have a similar note in the
documentation for `required_unless_present_any` pointing to that method
as well.

* docs: Fix `required` link in docs for `required_unless_present_all`

* docs: Correct "if" to "unless"
2021-02-15 08:20:11 +00:00
ldm0
73c682b652 Small code shrinking 2021-02-14 13:07:21 +00:00
ldm0
5cff16b6f9 Limit usage of inc_occurence_of 2021-02-14 11:21:12 +00:00
ldm0
78d7252b03 Remove Parser::need_more_vals 2021-02-14 11:21:12 +00:00
Pavan Kumar Sunkara
7b2be47de7
Merge pull request #2348 from ldm0/non_fmt_panic_fix
Bump version-sync version
2021-02-14 11:15:40 +00:00
ldm0
a684e9a51d Bump version-sync version 2021-02-14 09:51:23 +00:00
Pavan Kumar Sunkara
a8c9d28ead
Merge pull request #2346 from ldm0/non_fmt_panic_fix
Fix part of the non_fmt_panic warnings, bump version-sync to 0.9.2
2021-02-14 01:58:26 +00:00
Pavan Kumar Sunkara
5025ed3bee
Merge pull request #2345 from ldm0/usize
Change some u64 to usize
2021-02-14 01:57:53 +00:00
ldm0
ddb53af5dc Change some u64 to usize 2021-02-13 15:25:40 +00:00
ldm0
580d8d2c63 Fix part of the non_fmt_panic 2021-02-12 17:35:15 +00:00
Pavan Kumar Sunkara
90005de353
Merge pull request #2339 from clap-rs/settings
Remove Arg::settings to be consistent with App
2021-02-12 17:31:08 +00:00
Pavan Kumar Sunkara
6634444c3c Remove Arg::settings to be consistent with App 2021-02-12 10:42:38 +00:00
Pavan Kumar Sunkara
97343e4cef
Merge pull request #2340 from ldm0/ci
Fix CI on i686-unknown-linux-gnu
2021-02-12 08:20:30 +00:00
ldm0
5997626c41 Fix CI on i686-unknown-linux-gnu 2021-02-12 04:41:29 +00:00
Pavan Kumar Sunkara
8eb5081b53 Update changelog 2021-02-10 23:33:14 +00:00
Pavan Kumar Sunkara
f95a79dea4
Merge pull request #2336 from clap-rs/hidden_help
Better help message support for hidden and heading stuff
2021-02-08 06:02:54 +00:00
Pavan Kumar Sunkara
9aea23ca30
Merge pull request #2211 from clap-rs/mut_arg
Prefer mut_arg over help_about and version_about
2021-02-08 05:22:37 +00:00
Pavan Kumar Sunkara
2b5a23597a Better help message support for hidden and heading stuff 2021-02-08 05:22:27 +00:00
Pavan Kumar Sunkara
3758bba5e2 Remove help_about in favor of mut_arg 2021-02-07 17:22:56 +00:00
Pavan Kumar Sunkara
b824e0b088 Allow nested subcommands mutated generated args to take preference 2021-02-07 16:28:49 +00:00
Pavan Kumar Sunkara
423e2dde00 Remove version_about in favor of mut_arg 2021-02-07 16:14:07 +00:00
Pavan Kumar Sunkara
1bd902370a Add tests for mut_arg on help and version 2021-02-07 15:54:24 +00:00
Pavan Kumar Sunkara
93a737a4fa
Merge pull request #2333 from clap-rs/build_help_and_version_at_start
Build help and version args at the beginning
2021-02-07 15:53:45 +00:00
Pavan Kumar Sunkara
05ab92702d
Merge pull request #2297 from ldm0/parser
Parser refactor.
2021-02-07 15:11:09 +00:00
Pavan Kumar Sunkara
c9cb22905c Build help and version args at the beginning 2021-02-07 14:46:38 +00:00
ldm0
560aa536df Change tests prefix 2021-02-07 05:59:29 +00:00
ldm0
899b04f481 Remove clone 2021-02-07 05:40:02 +00:00