Commit graph

3517 commits

Author SHA1 Message Date
Lane Sawyer
392effe319 fix: Use character instead of string for Arg::Short
This PR switches the Arg::Short macro to take a character instead of a string. It removes the hacky code in the Method to_token method and implements the logic for Short when parsing the clap derive arguments.

Fixes #1815.
2020-06-17 09:45:05 -07:00
NickHackman
d785ebc14e fix: Flag Subcommands tests behind debug_asserts
Tests that check conflicts are behind the `debug_assertions` feature
2020-06-17 01:53:53 -04:00
NickHackman
32db427706 fix: duplicate short flags in Flag Subcommand test 2020-06-17 01:14:48 -04:00
NickHackman
f7c5b098b9 fix: duplicate flags in Flag Subcommand test 2020-06-17 00:56:05 -04:00
NickHackman
b09afcf653 fix: Gate fmt::Display for Flag w/ debug_asserts
Implementation of `fmt::Display` for `Flag` caused tests to fail when
not ran with `debug_assertions` feature.
2020-06-17 00:09:25 -04:00
NickHackman
bf3d947f01 fix: Flag Subcommands conflicts panic
Conflicts with Flag subcommands and Args now panics when
`debug_assertions` is enabled, rather than causing bizarre behavior.
2020-06-16 23:45:21 -04:00
NickHackman
806d7487c6 example: updated 23 docs & refractor
Improved printing instead of printing out the `Vec` using `{:?}`,
`join(", ")` for improved printing. Improved documentation to b emore
explicit and apply to removal of `FlagSubCommand` -> `App::short_flag`
and `App::long_flag`
2020-06-16 20:01:19 -04:00
NickHackman
02ebf4f816 fix: display visible short flags, visible flags
Flags weren't being set as visible in one instance. Flags were not being
printed in help message.
2020-06-16 01:13:58 -04:00
NickHackman
383606e099 tests: short_flag_alias methods
Tests that cover all methods for `short_flag_alias` corresponding methods
2020-06-16 01:11:53 -04:00
NickHackman
acb2f755f8 api: short_flag_aliases and corresponding methods
Aliases exclusively for `App::short_flag` that allow visible and hidden
short flag subcommands.
2020-06-16 00:13:21 -04:00
NickHackman
458736bee8 imp: Improved Flag Subcommand API
Instead of a `FlagSubCommand` struct the addition of two simple methods
to `App`. `App::long_flag` and `App::short_flag` that cover all the
bases of the many methods that were provided in `FlagSubCommand`. This
API is far simpler to use and more akin to the present `Arg::long` and `Arg::short`.
2020-06-15 21:52:36 -04:00
NickHackman
a9091d141c chore: removed debug print
Removed a `debug!` line that referenced me.
2020-06-13 18:02:05 -04:00
NickHackman
0b179fe8ef api: FlagSubCommand, subcommand flags #1361
Adds support for Flag subcommands, for example:

$ pacman -Ss
$ pacman --sync -s
2020-06-13 17:40:09 -04:00
NickHackman
50829711ef examples: FlagSubCommand pacman
Using `pacman` as an example for `FlagSubCommand` because of #1361
2020-06-13 12:32:17 -04:00
NickHackman
c89718fa57 tests: FlagSubCommand
Test all methods of `FlagSubCommand` and interactions with aliases
2020-06-13 11:32:24 -04:00
bors[bot]
81457178fa
Merge #1972
1972: Newline bug r=pksunkara a=stedingan



Co-authored-by: Andreas Steding <steding.andreas@gmail.com>
2020-06-10 19:32:52 +00:00
Andreas Steding
49cb37b303 Updated tests. 2020-06-10 15:45:27 +02:00
Andreas Steding
abef54862d changed write!() to writeln!() to add a newline 2020-06-10 15:35:54 +02:00
bors[bot]
055568d3fe
Merge #1964
1964: Updated Changelog and added the upgrader r=CreepySkeleton a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-06-10 10:22:58 +00:00
Pavan Kumar Sunkara
3d67fce807 Removed index.html 2020-06-10 09:48:37 +02:00
Pavan Kumar Sunkara
ce229660fc Backport changelog from v2 2020-06-10 09:48:37 +02:00
Pavan Kumar Sunkara
8bd1f1a9d3 Started on automatic upgrader 2020-06-10 09:48:37 +02:00
bors[bot]
d149999413
Merge #1967
1967: Reexport Indices r=pksunkara a=CreepySkeleton



Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-06-10 07:38:57 +00:00
Pavan Kumar Sunkara
1a276f8f4f Remove Arg::help 2020-06-10 09:34:55 +02:00
bors[bot]
d67c3bb7d3
Merge #1970
1970: refactor: removed clap_count_exprs macro r=pksunkara a=stedingan



Co-authored-by: Andreas Steding <steding.andreas@gmail.com>
2020-06-10 06:59:00 +00:00
Andreas Steding
294beff930 refactor: removed clap_count_exprs macro 2020-06-10 08:27:36 +02:00
CreepySkeleton
24ed93daae Reexport Indices 2020-06-09 08:39:07 +03:00
bors[bot]
0b487de9ce
Merge #1966
1966: fix: Corrected assertion arguments r=pksunkara a=stedingan



Co-authored-by: Andreas Steding <steding.andreas@gmail.com>
2020-06-08 22:40:24 +00:00
Andreas Steding
f3a9975085 fix: cargo fmt + clippy 2020-06-08 18:40:11 +02:00
Andreas Steding
7bc0fed82e fix: Corrected assertion arguments 2020-06-08 14:30:11 +02:00
bors[bot]
f4ace424c4
Merge #1958
1958: Fix custom help headings r=pksunkara a=vorot93



Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me>
2020-06-01 09:53:16 +00:00
Artem Vorotnikov
7a6310e26d
Update multiple_custom_help_headers test to cover #1955 2020-06-01 09:04:41 +03:00
Artem Vorotnikov
fc8a0bba9c
Make App's help heading a priority, optimize it 2020-06-01 08:39:58 +03:00
Artem Vorotnikov
2de5c0e44c
Fix custom help headings 2020-06-01 07:42:07 +03:00
bors[bot]
2da492e4dc
Merge #1953
1953: Proper debug in ArgGroup r=pksunkara a=CreepySkeleton



Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-05-31 17:58:24 +00:00
CreepySkeleton
41c4d186f1 Fix warnings 2020-05-31 17:53:24 +03:00
CreepySkeleton
12e8541678 Remove pointless test
Come on, who on earth needs to test exact content of debug output?!
2020-05-31 03:27:44 +03:00
CreepySkeleton
f1479974e0 Proper debug in ArgGroup 2020-05-31 01:32:50 +03:00
bors[bot]
229cbbf7a2
Merge #1950
1950: Limit text wrapping to 100 symbols by default r=pksunkara a=CreepySkeleton



Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-05-30 17:04:32 +00:00
CreepySkeleton
d6603c739d Limit text wrapping to 100 symbols by default 2020-05-30 19:34:48 +03:00
bors[bot]
9af127a4f4
Merge #1949
1949: docs: correct some typos r=pksunkara a=goncalor



Co-authored-by: Gonçalo Ribeiro <darklaw13@yahoo.co.uk>
2020-05-30 10:36:45 +00:00
Gonçalo Ribeiro
fb8e0d815d docs: correct some typos 2020-05-30 11:14:47 +01:00
bors[bot]
39ad139a3a
Merge #1948
1948: chore(Cargo.toml): bump proc-macro-error to 1 r=pksunkara a=paolobarbolini



Co-authored-by: Paolo Barbolini <paolo@paolo565.org>
2020-05-28 22:39:10 +00:00
Paolo Barbolini
d771d6debd chore(Cargo.toml): bump proc-macro-error to 1 2020-05-29 00:13:17 +02:00
bors[bot]
f96496af1a
Merge #1947
1947: Create FUNDING.yml r=pksunkara a=acfoltzer



Co-authored-by: Adam C. Foltzer <acfoltzer@acfoltzer.net>
2020-05-27 17:17:43 +00:00
Adam C. Foltzer
3710d59c93
chore: create FUNDING.yml
I recently released [`cargo-fund`](https://users.rust-lang.org/t/cargo-fund-discover-funding-links-for-your-projects-dependencies/43251?u=acfoltzer), and noticed that while there is sponsorship information in this repo, but it's not yet encoded in a machine-readable way. Adding this metadata will add a "Sponsor" button to the repo, and allow `cargo-fund` to show the project's sponsorship link. For more about this file format, see the [Github docs](https://help.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository).

Updated from the patch in #1944 with the Open Collective funding link.
2020-05-27 09:55:17 -07:00
bors[bot]
a5a006b891
Merge #1942
1942: Fix Arg::required doc examples r=pksunkara a=pickfire



Co-authored-by: Ivan Tham <pickfire@riseup.net>
2020-05-25 17:51:37 +00:00
Ivan Tham
270f9ce37f
Update src/build/arg/mod.rs
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-05-25 21:06:22 +08:00
Ivan Tham
a189770e1c
Fix Arg::required doc examples 2020-05-25 21:00:17 +08:00
bors[bot]
969b543b1b
Merge #1941
1941: Use proper fmt::DebugStruct facility in Debug impl r=pksunkara a=CreepySkeleton



Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-05-23 17:45:12 +00:00