Collin Styles
9f3cbcd149
docs: wrap Arg in backticks instead of quotes
...
This looks better and is more consistent with the rest of the
documentation.
2020-10-18 12:05:22 -07:00
Collin Styles
b3caf81918
docs: fix a bunch of broken documentation links
2020-10-18 12:05:19 -07:00
CastilloDel
acd3293af2
Add an assertion for positional args defining long or short
...
Also update the docs to reflect that Arg.index shouldn't be
used with long or short
2020-10-18 19:51:13 +01:00
Jacob Mischka
b3e638ad44
Add option to hide autogenerated env section from help text
2020-10-17 16:48:35 -05:00
bors[bot]
d2dd54b555
Merge #2172
...
2172: Don't use default value when option is passed r=pksunkara a=davidhewitt
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2020-10-14 20:54:10 +00:00
David Hewitt
94f6889116
Don't use default value when option is passed
2020-10-14 20:00:40 +01:00
Wim Looman
b31df047b8
Attach validation error as Error::source
2020-10-13 22:13:04 +02:00
bors[bot]
5a1a209965
Merge #2161
...
2161: Fix parser skipping options without heading set r=pksunkara a=CertainLach
Co-authored-by: Yaroslav Bolyukin <iam@lach.pw>
2020-10-11 08:55:33 +00:00
Donough Liu
7f627fceee
Change MissingArgumentOrSubcommand to DisplayHelpOnMissingArgumentOrSubcommand and don't use stderr
2020-10-11 15:42:47 +08:00
bors[bot]
4f90f3e4bb
Merge #2166
...
2166: Sort options base on option's short and long representation r=ldm0 a=ldm0
Co-authored-by: Donough Liu <ldm2993593805@163.com>
2020-10-10 18:54:49 +00:00
Donough Liu
15c77150a9
Sort options base on option's short and long representation
2020-10-11 02:08:10 +08:00
Marti Raudsepp
cda89a2af1
Fix typos and grammar
...
Some more fixes in addition to 594c535ba2
* Some I noticed manually.
* Some were found by Topy (https://github.com/intgr/topy ), either new
rules from Typo or new code in clap.
* `etc.` and `e.g.` rules were disabled during the last run.
2020-10-10 16:22:05 +03:00
Donough Liu
c9a407aa54
Fix: Don't mention unused subcommands (Partly cherry pick ef92e2b
)
...
Add `\t` for consistency
2020-10-10 03:34:28 +08:00
bors[bot]
4ff4879400
Merge #2154
...
2154: Fix the error logic and error message for suggesting `--` before a flag r=pksunkara a=ldm0
Co-authored-by: Donough Liu <ldm2993593805@163.com>
2020-10-09 19:05:13 +00:00
Yaroslav Bolyukin
6050a17024
fix : #2022
...
Parser was skipping default values for options with headings
Signed-off-by: Yaroslav Bolyukin <iam@lach.pw>
2020-10-09 23:45:11 +05:00
Donough Liu
9766aa11b1
Remove redundant(wrong) error processing
...
Argument prefixed by `-` will never inferred as a subcommand
Suggest using subcommand when supplied after `--`
Cargo fmt, adding test for wrongly using subcommand after `--`
Fix test
Fix clippy
2020-10-10 00:06:50 +08:00
Donough Liu
5815246fd9
Fix the error logic and error message for suggesting -- before a flag
...
Fix tests
Add test for issue #1284
Apply nitpicks
2020-10-10 00:04:22 +08:00
Pavan Kumar Sunkara
8131ead04b
More changelog and consistency
2020-10-09 17:05:51 +02:00
Pavan Kumar Sunkara
b931e25c79
Update MSRV to 1.42
2020-10-09 17:04:46 +02:00
bors[bot]
91633741e9
Merge #2143
...
2143: api(App): Adds help_about method to App. r=pksunkara a=pretzelhammer
Co-authored-by: pretzelhammer <7769424+pretzelhammer@users.noreply.github.com>
2020-09-26 06:55:58 +00:00
pretzelhammer
523729d3fc
api(App): Adds version_about method to App.
...
Version about text is now customizable and propagates to subcommands. Closes #1640 .
2020-09-25 09:06:35 -04:00
bors[bot]
87c9699931
Merge #2135
...
2135: fix(help messages): escape values in help messages r=pksunkara a=ninewise
Co-authored-by: Felix Van der Jeugt <felix.vanderjeugt@posteo.net>
2020-09-25 09:16:05 +00:00
Felix Van der Jeugt
d5c7c7d8bd
Fix clippy errors
2020-09-25 10:38:35 +02:00
pretzelhammer
33caf49793
api(App): Adds help_about method to App.
...
Help about text is now customizable and propagates to subcommands. Closes #2080 .
2020-09-24 17:53:02 -04:00
Felix Van der Jeugt
a083953d3a
Suggest corrections with double quotes
2020-09-24 17:58:35 +02:00
Pavan Kumar Sunkara
99b8830d0b
Remove unneeded cfg_attr
2020-09-24 13:51:02 +02:00
Pavan Kumar Sunkara
d881a1185b
Release 3.0.0-beta.2
...
clap@3.0.0-beta.2
clap_derive@3.0.0-beta.2
clap_generate@3.0.0-beta.2
Generated by cargo-workspaces
2020-09-18 20:32:41 +02:00
Felix Van der Jeugt
0f42344685
fix(help messages): escape whitespace values in help messages
2020-09-16 15:51:33 +02:00
bors[bot]
03c11607b5
Merge #2132
...
2132: Add missing links in docs. r=pksunkara a=newAM
Co-authored-by: Alex M <alexmgit@protonmail.com>
2020-09-12 18:28:23 +00:00
Alex M
96db338697
Add missing links in docs.
2020-09-12 10:15:14 -07:00
Alex M
3758725dc2
Fix for issue #2130 .
2020-09-12 09:52:52 -07:00
bors[bot]
3e9ee86713
Merge #2118
...
2118: Rename r=CreepySkeleton a=pksunkara
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-08-29 11:22:13 +00:00
bors[bot]
61786c4971
Merge #2117
...
2117: Remove useless code r=pksunkara a=CreepySkeleton
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-08-29 10:58:07 +00:00
Pavan Kumar Sunkara
55abd639f7
Rename get_*_no_heading to get_*_with_no_heading
2020-08-29 11:49:04 +02:00
Pavan Kumar Sunkara
9e381f92a9
Rename required_unless_eq_* to required_unless_present_*
2020-08-29 11:48:35 +02:00
CreepySkeleton
ccb1ea2d65
Remove useless code
...
This code does not serve any purpose as far as I can tell
2020-08-29 00:44:11 +03:00
CreepySkeleton
3a099a6627
Implement std::error::Error for clap::Error
2020-08-28 20:57:39 +03:00
bors[bot]
e4b5407296
Merge #1976 #2073
...
1976: Refactor r=pksunkara a=CreepySkeleton
2073: Add new "regex" feature r=CreepySkeleton a=bkaestner
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
Co-authored-by: Benjamin Kästner <benjamin.kaestner@gmail.com>
2020-08-28 17:14:31 +00:00
CreepySkeleton
5020333037
Refactor coloring
2020-08-28 19:21:05 +03:00
Benjamin Kästner
cde1a2d218
regex: Introduce convenience Cow-wrapper RegexRef
...
As previously discussed on [GitHub], this commit introduces a Cow-like
wrapper RegexRef to enable both `Regex` as well as `&Regex` as
arguments.
It also introduces a new module in the `build:arg` path to remove
clutter from the main module. For more information see #2073 .
[GitHub]: https://github.com/clap-rs/clap/pull/2073#issuecomment-674442310
2020-08-26 17:54:54 +02:00
Benjamin Kästner
8cb9a7d486
Add new "regex" feature
...
This commit introduces a new feature called `"regex"`. It adds a new
function `validator_regex` to `Arg` and was inspired by the discussion
in #1968 . The name `validator_regex` was chosen instead of
`regex_validator` to make sure that the developer keeps in mind that
there may only be a single `Validator` on an `Arg`.
The feature can be used with YAML files, however there is no proper
pattern in `clap_app!` (yet).
2020-08-26 17:54:54 +02:00
Sergey Dubovyk
d525be42c5
chore: use if instead of matching
...
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-08-25 11:07:19 +03:00
knidarkness
530b179776
fix: detect if space should be added before spec_vals
2020-08-25 10:41:08 +03:00
bors[bot]
29df5c2d16
Merge #2100 #2106
...
2100: Allow for nested subcommands with ZSH generation. r=pksunkara a=newAM
2106: Update the env var example for derive r=pksunkara a=rgreinho
Co-authored-by: Alex M <alexmgit@protonmail.com>
Co-authored-by: Rémy Greinhofer <remy.greinhofer@gmail.com>
2020-08-24 06:45:45 +00:00
bors[bot]
7853903052
Merge #2102
...
2102: Fix propagation r=pksunkara a=CreepySkeleton
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-08-24 06:22:27 +00:00
CreepySkeleton
1cd069090e
Fix propagation
2020-08-23 20:56:29 +03:00
Alex M
60dfcf13b5
Allow for nested subcommands with ZSH generation.
2020-08-23 09:33:29 -07:00
Simon Morgan
2e973a2649
Fix a few documentation typos
2020-08-22 16:49:09 +01:00
CreepySkeleton
28ad25fe66
Ensure the lifetime is 'static
2020-08-21 08:41:50 +03:00
CreepySkeleton
fd1ee7872e
Make caching in crate_authors! actually work
2020-08-21 08:21:21 +03:00
bors[bot]
ed3bb993c5
Merge #2087
...
2087: refactor: Avoid second traversal and unwrap r=pksunkara a=phimuemue
Co-authored-by: philipp <descpl@yahoo.de>
2020-08-21 03:56:53 +00:00
aspen
96b7fd454b
Forbid all unsafe code.
2020-08-20 18:38:40 -04:00
philipp
86dc14f5cd
refactor: Avoid second traversal and unwrap
2020-08-20 19:32:53 +02:00
Danil Kondratiev
4878f7b7b1
don't print spaces in long help
2020-08-20 17:25:36 +03:00
bors[bot]
1e3d53fd1f
Merge #2081
...
2081: Polish doc comments for App r=CreepySkeleton a=mkantor
Co-authored-by: Matt Kantor <the.matt.kantor@gmail.com>
2020-08-17 20:56:13 +00:00
bors[bot]
025ec3c28b
Merge #2078
...
2078: Unify naming cheme r=pksunkara a=CreepySkeleton
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-08-17 20:35:05 +00:00
Matt Kantor
f6e28c5ff0
Remove doc mention of no-longer-existing from_yaml method.
2020-08-17 12:54:24 -07:00
Matt Kantor
494fddd06e
Polish doc comments for App.
...
- Fix some links.
- Make the punctuation consistent.
- Correct some spelling/grammar mistakes.
2020-08-17 11:00:00 -07:00
tomjw64
27771ceeb7
Show arguments in conflict message in reverse order of input
2020-08-16 03:47:19 -05:00
tomjw64
97149e37f5
Remove underscore prefix for build_conflict_err_usage
2020-08-16 03:42:58 -05:00
tomjw64
35f761e699
Extract extra logic to _build_conflict_err_usage
2020-08-15 17:58:47 -05:00
CreepySkeleton
f4fb9db65c
cargo fmt
2020-08-16 00:29:30 +03:00
CreepySkeleton
0b2eac4da7
Fix yaml support
2020-08-15 23:42:23 +03:00
CreepySkeleton
ce3171ace5
Arg::required_unless_all => required_unless_eq_all
2020-08-15 20:38:57 +03:00
CreepySkeleton
b12102c832
Arg::required_unless -> required_unless_present
2020-08-15 20:38:56 +03:00
CreepySkeleton
55dceca819
Improve documentation
2020-08-15 20:38:56 +03:00
CreepySkeleton
233af6e7a1
Arg::required_if => required_if_eq
2020-08-15 20:38:55 +03:00
CreepySkeleton
8b85c4ecea
Arg::required_ifs => required_if_eq_any
2020-08-15 20:38:12 +03:00
CreepySkeleton
6b6b6035ed
Arg::required_unless_one => required_unless_eq_any
2020-08-15 20:38:11 +03:00
tomjw64
481229fffd
Remove stray print
2020-08-15 04:49:53 -05:00
tomjw64
826db05319
Add test for three argument conflict output
2020-08-15 04:43:12 -05:00
tomjw64
6602feb9e6
Also include required arguments in conflict output
2020-08-15 04:17:28 -05:00
tomjw64
937e14f6e8
Remove latter conflicting arg from usage message
2020-08-15 03:17:16 -05:00
bors[bot]
26aa746c3a
Merge #2067
...
2067: Use a template to produce the default help message r=pksunkara a=mkantor
Co-authored-by: Matt Kantor <the.matt.kantor@gmail.com>
2020-08-14 23:42:38 +00:00
Matt Kantor
85d3daa8c1
Use a different default template when there are no args.
...
This eliminates extraneous empty lines when there are no user-defined
args, the default args are disabled, and `after_help` is set.
2020-08-14 14:02:52 -07:00
Matt Kantor
4545a47ff6
Fix: {before-help} should have fallback just like {after-help}.
2020-08-14 13:58:37 -07:00
Benjamin Kästner
2b101ad7e5
Properly handle YAML null macros for default_value_if
...
The macro `yaml_opt_str` is only used in `yaml_tuple3`, which again is
only used for `default_value_if`. Unfortunately, the current test
doesn't make sense, as a v.is_null() indicates a Yaml::Null, on wich
`as_str()` always returns `None`. Instead, the condition should be
negated, as the documentation of `default_value_if` hints:
> **NOTE:** If using YAML the values should be laid out as
> follows (`None` can be represented as `null` in YAML)
The case `$v.is_null()` should therefore lead to `None`, whereas all
other cases should be interpreted `as_str()`.
2020-08-14 18:28:43 +02:00
Matt Kantor
2c91800099
Restore details to doc comment for help_template.
2020-08-14 09:27:42 -07:00
Matt Kantor
afcacb0626
Apply wrapping to {author} and {about} template tags.
...
Previously wrapping was only applied to the {*-with-newline} variants.
2020-08-14 09:14:14 -07:00
Matt Kantor
059503e54d
Make {before-help} and {after-help} template tags include padding.
...
Previously there were separate tags for this, {before-help-padded} and
{after-help-padded}. Those have been removed and the default ones
given their behavior.
2020-08-14 09:14:10 -07:00
Matt Kantor
a87320ae88
Use a template to produce the default help message.
...
This makes some changes to the template system:
- Template tags for optional items (like {author}) now expand to
nothing when the value is unset instead of a default string (like
"unknown author").
- Many template tags now emit line-wrapped output to match
write_default_help.
- Items with long variants now expand to the appropriate thing for -h
vs --help.
- The now-obsolete {long-about} tag has been removed.
- A few new tags have been added.
These are externally-visible changes, but if this makes it into 3.0
that's probably reasonable?
Note that line-wrapping can have some odd edge cases since it does not
account for preceding/trailing characters on the same line as the tag.
This is already the case in master, but will affect some additional
tags with this changeset. See #2065 for details.
Closes #2002 .
2020-08-13 17:52:48 -07:00
bors[bot]
ca6c84fa8a
Merge #1961
...
1961: V3 docs r=CreepySkeleton a=pksunkara
Co-authored-by: Kevin K <kbknapp@gmail.com>
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-08-12 14:58:09 +00:00
bors[bot]
2df656c98d
Merge #1998
...
1998: Relax some restrictions on validators r=pksunkara a=CreepySkeleton
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-08-12 14:35:39 +00:00
Pavan Kumar Sunkara
c2e3b719ae
Apply suggestions from code review
...
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-08-12 15:50:15 +02:00
CreepySkeleton
39fadbf7c8
Rebase
2020-08-12 16:40:19 +03:00
CreepySkeleton
32414fbdff
Fix and rearrange debug asserts
2020-08-12 06:12:42 +03:00
CreepySkeleton
18a58af3ac
Allow validators to be FnMut
2020-08-12 02:39:59 +03:00
CreepySkeleton
790a0f5e62
Make sure that App & Arg & ArgGroup implement Send + Sync
...
Also relaxes 'static restriction on validators.
2020-08-12 02:39:59 +03:00
Matt Kantor
0d8ebeb36b
Fix doc comment for Arg::long_about.
2020-08-11 15:30:30 -07:00
Matt Kantor
f7e2fbf150
Print an empty line after multi-line argument help.
...
Fixes #1642 .
2020-08-11 15:30:30 -07:00
Pavan Kumar Sunkara
5c0947f160
Add derive traits only if derive feature is enabled
2020-08-11 16:30:02 +02:00
Pavan Kumar Sunkara
9b22f19995
Update more docs
2020-08-11 16:08:05 +02:00
Kevin K
89fcc755e4
wip: doc updates for App
...
Still more to do in this file, hence the wip status
2020-08-11 15:41:00 +02:00
Kevin K
aa694c893f
docs(FromArgMatches): initial draft
2020-08-11 15:21:58 +02:00
Kevin K
763f0a0363
wip: Clap trait docs
2020-08-11 15:21:57 +02:00
bors[bot]
da92a32d10
Merge #2048
...
2048: Change the ret tyte of Argmatches::subcommand r=pksunkara a=CreepySkeleton
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-08-11 00:20:35 +00:00
Marti Raudsepp
64ee0f8009
Add hinting of arg value types for zsh/fish completion
...
Adds new method/attribute `Arg::value_hint`, taking a `ValueHint` enum
as argument. The hint can denote accepted values, for example: paths,
usernames, hostnames, commands, etc.
This initial implementation supports hints for the zsh and fish
completion generators, support for other shells can be added later.
2020-08-06 22:17:31 +03:00
CreepySkeleton
e6cc49ecde
Adjust derive
2020-08-05 17:07:13 +03:00
CreepySkeleton
e9759a241b
Adjust examples and tests
2020-08-05 17:07:13 +03:00
CreepySkeleton
6dcf93be00
Change the return type of ArgMatches::subcommand()
2020-08-05 13:35:42 +03:00
Nicholas Nethercote
ed46e8962c
refactor: Combine two large and very similar expressions.
2020-07-29 10:35:36 +10:00
Nicholas Nethercote
7fb397d905
refactor: Simplify some it.any(...)
calls.
2020-07-29 10:35:34 +10:00
Nicholas Nethercote
be535e28cf
refactor: Avoid unnecessary uses of enumerate()
.
2020-07-29 10:35:31 +10:00
Nicholas Nethercote
d8c775eb26
refactor: Replace it.filter(...).find(...)
with it.find(...)
.
2020-07-29 10:35:27 +10:00
bors[bot]
dbdd63b350
Merge #2016
...
2016: imp(errors): Provide the missing required arguments as info r=CreepySkeleton a=nickelc
Co-authored-by: Constantin Nickel <constantin.nickel@gmail.com>
2020-07-26 08:08:35 +00:00
bors[bot]
dda961b715
Merge #2027
...
2027: style: rename ErrorKind::{VersionDisplayed, HelpDisplayed} to present tense r=CreepySkeleton a=siyopao
Co-authored-by: Craig Pastro <siyopao@gmail.com>
2020-07-26 07:36:52 +00:00
CreepySkeleton
37c1631f06
Make lifetimes descriptive
2020-07-21 18:59:07 +03:00
bors[bot]
1d57aa2ffb
Merge #2030
...
2030: style: replacing yml with yaml for consistency r=pksunkara a=marcospb19
Co-authored-by: João Marcos <marcospb19@hotmail.com>
2020-07-21 13:11:15 +00:00
bors[bot]
aab97614ed
Merge #2020
...
2020: Implementation of feature request #1918 r=pksunkara a=leo-lb
Co-authored-by: Léo Le Bouter <lle-bout@zaclys.net>
2020-07-21 09:47:23 +00:00
João Marcos
24760bc261
style: replacing yml with yaml for consistency
2020-07-20 20:58:34 -03:00
Léo Le Bouter
eabe8b67b4
Implementation of feature request #1918
2020-07-20 15:35:40 +02:00
Craig Pastro
866f2edbed
style: rename ErrorKind::{VersionDisplayed, HelpDisplayed} to present tense
2020-07-20 10:27:07 +09:00
Blaxar Waldarax
748aea39f3
feat: Added {before/after}_help_long to App struct, closed #1903
2020-07-19 13:59:53 +02:00
Marti Raudsepp
594c535ba2
Fix various typos in docs & code
...
Most errors detected and fixed with Topy (https://github.com/intgr/topy ),
all verified by hand.
2020-07-19 03:10:28 +03:00
bors[bot]
ff6beebd6e
Merge #1974
...
1974: Flag subcommands r=CreepySkeleton a=NickHackman
Co-authored-by: NickHackman <snickhackman@gmail.com>
Co-authored-by: Nick Hackman <31719071+NickHackman@users.noreply.github.com>
2020-07-18 14:06:50 +00:00
NickHackman
6c6b9db45c
fix: clippy lint warning - name change
...
Lint name changed clippy::block_in_if_condition_stmt -> clippy::block_in_if_conditions
2020-07-16 18:05:25 -04:00
NickHackman
21436398a2
docs: improved flag subcommand documentation
...
Improved documentation in flag subcommand example and in
`App::short_flag` and `App::long_flag` method documentation.
2020-07-16 17:48:00 -04:00
Constantin Nickel
6fe48fd51f
imp(errors): Provide the missing required arguments as info
2020-07-15 00:52:06 +02:00
Constantin Nickel
fbfbf8df99
feat(macros): Add @global_setting $setting
to set global settings
2020-07-13 15:13:04 +02:00
NickHackman
0ddd58c935
fix: clippy lint warning
...
Not necessary to borrow the to_string for comparison
2020-07-11 15:21:53 -04:00
NickHackman
6ddf940ac3
fix: conflicts between flag scs and args alias
...
When debug_assertions flag is active, properly handles conflicts between
flag subcommands short and long their aliases and args and their
aliases prevents self conflicts where the alias and the flag subcomand
were the same.
2020-07-11 15:01:18 -04:00
NickHackman
cf9265d660
fix: failing doc test
2020-07-10 09:36:39 -04:00
NickHackman
5118cec1b1
fix: long_flag_aliases instead of using alias
...
Previously long_flag alias checks were against normal aliases instead of
specifically designated long_flag aliases, this is more clear and explicit.
2020-07-10 09:27:14 -04:00
NickHackman
f5aabfa482
style: rename short, long -> short_flag, long_flag
...
These names are more explicit about what short and
long flag subcommands are.
2020-07-10 08:52:13 -04:00
bors[bot]
d8fccdb0ea
Merge #1986
...
1986: Custom subcommand placeholders r=pksunkara a=kitlith
Co-authored-by: Kitlith <kitlith@kitl.pw>
2020-07-10 12:51:30 +00:00
bors[bot]
608b982bbe
Merge #1997
...
1997: Cleanup setings r=pksunkara a=CreepySkeleton
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-07-10 09:53:47 +00:00
NickHackman
0a266f8c8c
fix: merge related issues
...
get_subcommands() now returns an impl Iterator rather than a slice,
match_alias! removed
2020-07-09 22:15:48 -04:00
Nick Hackman
27441329f9
Merge branch 'master' into flag-subcommands
2020-07-09 21:31:13 -04:00
NickHackman
a3f8ddb0b0
doc: removed '[``]' from documentation
2020-07-08 21:46:00 -04:00
NickHackman
1127ca6e13
feat: Usage displays short, long, and normal scs
...
Displayed in the form of
pacman {query, --query, -Q} [OPTIONS]
2020-07-08 21:37:56 -04:00
NickHackman
ec35ab8813
feat: long flag subcommand infer
...
Added tests and feature to infer long flag subcommands similarly to
normal subcommands.
2020-07-08 00:11:28 -04:00
NickHackman
1ea7178629
refractor: find_*_subcmd macro -> fn
...
Moved from macro implementations to function implementations.
2020-07-07 22:57:38 -04:00
NickHackman
59a14f8e6a
fix: no longer cloning all Apps and Args for debug
...
Previously `Flag::App` and `Flag::Arg` both owned their App/Arg which
required many, many clones. This is unnecessary.
2020-07-07 22:36:12 -04:00
NickHackman
5db25e6a72
refractor: improved parser ergonomics
...
No longer abusing external_subcommand, but using subcmd_name in order to
parse a subcommand, added a `keep_state` variable in order to handle the
hacky solution of short command line arguments.
2020-07-07 22:26:44 -04:00
Kitlith
96daa203b9
cargo fmt
2020-07-07 00:23:00 -07:00
Kitlith
5f601b7ecd
Manually specify the header for subcommands.
...
Also fleshed out the documentation for subcommand_placeholder a bit.
2020-07-06 20:08:26 -07:00
bors[bot]
e8d46f4036
Merge #1989
...
1989: Replace macros with proper functions r=pksunkara a=CreepySkeleton
Co-authored-by: CreepySkeleton <creepy-skeleton@yandex.ru>
2020-07-06 18:51:07 +00:00
CreepySkeleton
7e8d120543
Make getters return iterators rather than slices
2020-07-06 17:33:02 +03:00
CreepySkeleton
46679d88d6
Use method(bool) instead of manipulating ArgSettings explicitly
2020-07-02 05:42:28 +03:00
CreepySkeleton
b23890358a
Remove ArgSettings::UseValueDelimiter
2020-07-02 05:02:28 +03:00
Pavan Kumar Sunkara
e68ec35a90
Move to terminal_size dep after the recent textwrap upgrade
2020-07-01 09:46:10 +02:00
Kitlith
6d083f5653
imp(subcommands): "SUBCOMMANDS" label affected by subcommand placeholder
2020-06-27 14:21:17 -07:00
CreepySkeleton
a3206197ff
cargo clippy + fmt
2020-06-27 04:30:02 +03:00
CreepySkeleton
f904bebd9a
Ditch find_subcnd*! and match_alias!
2020-06-27 04:30:02 +03:00
CreepySkeleton
f143b2f70e
Ditch names! and sc_names!
2020-06-27 04:30:02 +03:00
CreepySkeleton
a9b022d777
Ditch longs!
2020-06-27 04:30:02 +03:00
CreepySkeleton
270fd55f60
Ditch groups_for_arg!
2020-06-27 04:30:02 +03:00
CreepySkeleton
b7be22e90b
Ditch opts! and positionals!
2020-06-27 04:30:01 +03:00
CreepySkeleton
f46af5b96b
Ditch flags!
2020-06-27 04:30:01 +03:00
Kitlith
3d406400ec
Allow changing the "SUBCOMMAND" placeholder text in usage ( #1597 )
2020-06-25 17:27:25 -07:00