Pavan Kumar Sunkara
8ff68080e6
Merge pull request #2603 from hosseind88/remove-a-redundant-word-in-AppSettings-NoBinaryName-enum-explanation
...
Remove a redundant word in AppSettings::NoBinaryName enum explanation
2021-07-19 15:03:17 +01:00
hosseind88
cc2e07ea61
Remove a redundant word in AppSettings::NoBinaryName enum explanation
2021-07-19 17:56:57 +04:30
Pavan Kumar Sunkara
d8f6878db8
Merge pull request #2593 from epage/skip
...
feat(derive): Allow skipping ArgEnum variants
2021-07-17 04:57:08 +01:00
Ed Page
c1e272ea6c
feat(derive): Allow skipping ArgEnum variants
...
Depends on #2590
Fixes #2592
2021-07-16 17:04:20 -05:00
Pavan Kumar Sunkara
060c6da9ef
Merge pull request #2590 from epage/dead
...
fix(derive): Don't generate dead code
2021-07-16 22:57:29 +01:00
Ed Page
a8ba4c3b73
fix(derive): Don't generate dead code
...
When debugging #2586 , I noticed we were developing match cases for
variant names that were flattened. At minimum, this is dead code and at
worst this could cause the wrong behavior if a user does an update with
one of those names.
Depends on #2587
Fixes #2588
2021-07-16 15:39:52 -05:00
Pavan Kumar Sunkara
fbd8e6d742
Merge pull request #2587 from epage/sub
...
fix(derive): Allow subcommands to directly nest in subcommands
2021-07-16 21:39:05 +01:00
Ed Page
48356c34fb
fix(derive): Allow subcommands to directly nest in subcommands
...
`structopt` originally allowed
```
pub enum Opt {
Daemon(DaemonCommand),
}
pub enum DaemonCommand {
Start,
Stop,
}
```
This was partially broken in #1681 where `$ cmd daemon start` works but `cmd daemon`,
panics. Originally, `structopt` relied on exposing the implementation
details of a derived type by providing a `is_subcommand` option, so we'd
know whether to provide `SubcommandRequiredElseHelp` or not. This was
removed in #1681
Fixes #2005
2021-07-16 14:58:45 -05:00
Pavan Kumar Sunkara
62588bd82c
Merge pull request #2586 from epage/args
...
fix(derive)!: Compile-error on nested subcommands
2021-07-16 16:44:21 +01:00
Pavan Kumar Sunkara
4beb1aa354
Merge pull request #2600 from jvbreen1/patch-1
...
Change some wording to be more inclusive
2021-07-16 15:33:14 +01:00
John Breen
a2e5cc2bec
Change some wording to be more inclusive
2021-07-15 17:03:25 -04:00
Ed Page
53a9802ab2
chore(derive): Ensure license is recorded for subcommand
2021-07-15 12:04:04 -05:00
Ed Page
7f08773a5a
fix(derive)!: Compile-error on nested subcommands
...
Before, partial command lines would panic at runtime. Now it'll be a
compile error
For example:
```
pub enum Opt {
Daemon(DaemonCommand),
}
pub enum DaemonCommand {
Start,
Stop,
}
```
Gives:
```
error[E0277]: the trait bound `DaemonCommand: clap::Args` is not satisfied
--> clap_derive/tests/subcommands.rs:297:16
|
297 | Daemon(DaemonCommand),
| ^^^^^^^^^^^^^ the trait `clap::Args` is not implemented for `DaemonCommand`
|
= note: required by `augment_args`
```
To nest this, you currently need `enum -> struct -> enum`. A later
change will make it so you can use the `subcommand` attribute within
enums to cover this case.
This is a part of #2005
2021-07-15 11:45:13 -05:00
Pavan Kumar Sunkara
fbcf079e78
Merge pull request #2595 from epage/move
...
refactor: Move code to future trait locations
2021-07-14 23:32:52 +01:00
Pavan Kumar Sunkara
bc03c94e2e
Merge pull request #2594 from nirvdrum/patch-1
...
Fix a small typo in the README
2021-07-14 22:06:31 +01:00
Kevin Menard
171148873c
Fix a small typo in the README
2021-07-14 17:05:20 -04:00
Ed Page
507f0bf1cc
refactor(derive): Move into_app into coupled derives
2021-07-14 16:01:47 -05:00
Ed Page
f6fa3771a6
refactor(derive): Order args.rs by use
2021-07-14 15:55:31 -05:00
Ed Page
58dd1d5c5a
refactor(derive): Move from_arg_matches into coupled derives
2021-07-14 15:55:03 -05:00
Pavan Kumar Sunkara
894be6799c
Merge pull request #2585 from epage/argenum
...
fix(derive): `Clap` should not derive `ArgEnum`
2021-07-14 18:01:31 +01:00
Ed Page
6cc76e7237
fix(derive): Clap
should not derive ArgEnum
...
While having convinience derives can be helpful, deriving traits that
are not used in similar situations (`Clap` and `ArgEnum`) can make
things harder
- From a user, derives are opaque and create uncertainty on how to use
the API if not kept crystal clear (deriving a name gives you the trait
by that name)
- This makes documentation harder to write and read
- You can use types in unintended places, which is made worse for crate
APIs because changing this breaks compatibility.
Fixes #2584
2021-07-14 10:50:26 -05:00
Pavan Kumar Sunkara
af6f7af368
Merge pull request #2577 from tshepang/fix-links
...
fix remaining intra-doc links
2021-07-13 00:43:28 +01:00
Ed Page
3be79b9e1b
docs(derive): Update trait doc-comments ( #2579 )
...
* docs(derive): Update trait doc-comments
* Apply suggestions from code review
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2021-07-12 21:43:03 +01:00
Pavan Kumar Sunkara
006a5fed31
Merge pull request #2578 from codedust/patch-1
...
Fix grammar in `require_delimiter` fn docs
2021-07-11 11:21:20 +01:00
codedust
15d49064c3
Fix grammar in require_delimiter
fn docs
2021-07-11 12:19:54 +02:00
Tshepang Lekhonkhobe
b4eddf158d
fix remaining intra-doc links
2021-07-10 21:00:34 +02:00
Pavan Kumar Sunkara
a11ca85e8f
Merge pull request #2572 from SimpleIndian/master
...
Fixed overflowed code snippet
2021-07-07 16:48:25 +01:00
Souvik Mandal
2da46486e4
Fixed overflowed code snippet
2021-07-07 20:37:45 +05:30
Pavan Kumar Sunkara
b5d340bba9
Merge pull request #2571 from theidexisted/patch-1
...
Simplify example code
2021-07-06 12:11:15 +01:00
theidexisted
dd29c3a52c
Simplify example code
2021-07-06 18:00:33 +08:00
Pavan Kumar Sunkara
f0c5ea5e15
Merge pull request #2569 from tshepang/fix-links
...
fix a bunch of intra-doc links
2021-07-04 00:20:59 +01:00
Tshepang Lekhonkhobe
f5758034f0
fix a bunch of intra-doc links
2021-07-03 23:59:46 +02:00
anatawa12
89d1519f69
Show summary in subcommands list ( #2558 )
...
* Show short about in SUBCOMMANDS list
* add tests
* move test
* cargo fmt
2021-06-20 16:28:50 +01:00
Pavan Kumar Sunkara
c5cbc750cb
Merge pull request #2548 from remilauzier/master
...
Update dependency that need no change
2021-06-18 00:51:18 +01:00
Ethan Budd
6a48698fcd
Add a new arg option for the max_occurrences ( #2543 )
...
* add a new arg option for the max_occurrences
* check ErrorKind in tests
* Updated grammer in doc comments
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
* assert is_err() before unwraping
Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2021-06-17 19:54:24 +01:00
Pavan Kumar Sunkara
373ded784c
Fix clippy lint
2021-06-17 19:19:56 +01:00
Rémi Lauzier
48147d680b
Update dependency that need no change
2021-06-17 13:58:40 -04:00
Pavan Kumar Sunkara
a531d3935a
Merge pull request #2544 from remilauzier/master
...
Fix some nightly clippy warnings
2021-06-17 17:30:01 +01:00
Pavan Kumar Sunkara
641bd72d06
Update feature_request.yml
2021-06-17 12:12:51 +01:00
Rémi Lauzier
c4f534228b
Fix some nightly clippy warnings
2021-06-16 23:25:13 -04:00
Pavan Kumar Sunkara
947523f7f5
Merge pull request #2480 from kolloch/feature/partial-parsing
...
setting: IgnoreErrors - Allow parsing despite missing option values
2021-06-16 09:09:52 +01:00
Pavan Kumar Sunkara
412b71efb6
Merge pull request #2538 from clap-rs/multiple
...
Removed Arg::multiple
2021-06-16 09:08:39 +01:00
Pavan Kumar Sunkara
e5e20b389e
Forbid multiple_occurrences for positional args
2021-06-16 08:27:04 +01:00
Pavan Kumar Sunkara
3f94d17c71
Removed Arg::multiple
2021-06-16 07:17:11 +01:00
Pavan Kumar Sunkara
43909ddefc
Fix some docs for app settings
2021-06-16 02:54:49 +01:00
Pavan Kumar Sunkara
cedd110f10
Solve indexmap issue on WSL in ubuntu
2021-06-16 02:27:49 +01:00
Peter Kolloch
171dcbe424
setting: IgnoreErrors - Reaction to review comments
...
https://github.com/clap-rs/clap/pull/2480
2021-06-14 10:26:23 +02:00
Peter Kolloch
b0310e2d6e
settings: IgnoreErrors - prefix debug statements with fn name
2021-06-14 10:26:23 +02:00
Peter Kolloch
c50d338962
setting: IgnoreErrors - Allow parsing despite missing option values
...
Implemented as AppSetting::Ignore errors as suggested by
@CreepySkeleton in
https://github.com/clap-rs/clap/issues/1880#issuecomment-637779787 .
This is not a complete implementation but it works already in
surprisingly many situations.
https://github.com/clap-rs/clap/issues/1880
2021-06-14 10:26:18 +02:00
Pavan Kumar Sunkara
36c972a302
Merge pull request #2532 from tshepang/missing-type
...
the word "Subcommand" was accidentally removed
2021-06-13 23:46:33 +01:00