Commit graph

3791 commits

Author SHA1 Message Date
Donough Liu
d7e2fd6294 Add regression test for issue 1794 2020-12-09 01:13:05 +08:00
Donough Liu
573dc245e6 Fix incorrect error message. 2020-12-09 01:12:58 +08:00
Jonas Platte
041bfda7ca
Fix a typo in the Clap trait docs (#2243)
* Fix a typo in the Clap trait docs

* Update src/derive.rs

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-12-08 01:40:18 +00:00
Pavan Kumar Sunkara
3520a30b6e
Merge pull request #2232 from Riptide3/fix-readme
docs(README.md): remove unused import in "Using Builder Pattern" example
2020-11-29 09:01:22 +00:00
Riptide3
8b631d5db3 docs(README.md): remove unused import in "Using Builder Pattern" example 2020-11-29 16:10:22 +08:00
Pavan Kumar Sunkara
ad9f97f402 Fix ui tests 2020-11-28 19:16:58 +00:00
Pavan Kumar Sunkara
8395822a0b
Merge pull request #2231 from Aaron1011/fix/arg-matches-hygiene
Fix hygiene of `arg_matches` parameter
2020-11-28 17:51:53 +00:00
Aaron Hill
6dc8353fe2
Fix hygiene of arg_matches parameter
In the `Clap` derive macro, a function parameter named `arg_matches` is
generated using `quote!` - as a result, this parameter ends up with
call-site hygiene. However, `arg_matches` is written literally within
several `quote_spanned!` blocks, which generate an `arg_matches` token
with the hygiene of whatever span was passed to `quote_spanned!`.

If these two hygienes are different (for example, if the user invokes
the derive macro from a `macro_rules!` macro), then a usage of
`arg_matches` may not resolve to the `arg_matches` parameter definition.

This commit changes the generation of `arg_matches` identifiers to
always use `quote!`, ensuring that they will always be considered the
'same' identifier by Rust.
2020-11-28 12:22:57 -05:00
Pavan Kumar Sunkara
3c93f276b5
Merge pull request #2230 from ahkrr/master
refactor: TODO 1.46.0, improve readability by using [] operator
2020-11-28 13:11:50 +00:00
Pavan Kumar Sunkara
c8184470ff
Merge pull request #2140 from ldm0/validator_fixme
Resolve a FIXME
2020-11-28 13:11:38 +00:00
Pavan Kumar Sunkara
4d373c19a7
Merge pull request #2228 from clap-rs/maintenance
Update MSRV to 1.46
2020-11-28 13:11:21 +00:00
Pavan Kumar Sunkara
b89163afb6 Update MSRV to 1.46 2020-11-28 11:58:28 +00:00
Pavan Kumar Sunkara
56aeb155e1 Test rust regression 2020-11-28 11:47:18 +00:00
hk
bb7c9896b0 refactor: TODO 1.46.0, improve readability by using [] operator 2020-11-28 11:38:34 +01:00
Donough Liu
cad893ed04 Resolve a FIXME 2020-11-28 18:31:42 +08:00
Pavan Kumar Sunkara
0242afee81
Merge pull request #2227 from arthmis/master
Changing grammar for error message
2020-11-28 10:11:16 +00:00
arthmis
a97e24630d chore: changing unrequired to non-required 2020-11-27 15:37:26 -05:00
arthmis
1b4a4596f6 docs: fixing a typo 2020-11-27 15:19:03 -05:00
arthmis
4e6a371851 chore: changing awkward grammar for positional argument error message 2020-11-27 15:12:28 -05:00
Pavan Kumar Sunkara
d36d91173d
Merge pull request #2191 from ahkrr/master
fix(clap_generate): zsh completion generation panic
2020-11-26 18:36:41 +00:00
Pavan Kumar Sunkara
821d79aac7
Merge pull request #1878 from lu-zero/update_from_arg_matches
Add update_from_arg_matches to FromArgMatches
2020-11-14 12:38:16 +01:00
Luca Barbato
d18ff58391 Add a skip test 2020-11-14 11:09:39 +01:00
Luca Barbato
3e51839383 Rename the update trait methods 2020-11-14 10:58:30 +01:00
Luca Barbato
ac3e5f9a8f Factor out argument parsing generation 2020-11-14 10:53:13 +01:00
Luca Barbato
7a5c12e79a Avoid a level of indirection for augment_*subcommand 2020-11-14 10:17:13 +01:00
Luca Barbato
77e4e65e31 Address new clippy lints 2020-11-14 10:17:13 +01:00
Luca Barbato
9ebb46d65c Test for partial updates 2020-11-14 10:17:13 +01:00
Luca Barbato
5d342a7438 Update to the new from_subcommand logic 2020-11-14 10:17:13 +01:00
Luca Barbato
a9276576d7 wip: Add a variant for augment* for updates 2020-11-14 10:17:13 +01:00
Luca Barbato
8b6255057d wip: Complete update_subcommand
external subcommand updating is equivalent to replace it
2020-11-14 10:17:13 +01:00
Luca Barbato
646b3fe811 wip: Add tests and user-facing functions 2020-11-14 10:17:13 +01:00
Luca Barbato
d1fc83a8fa wip: Add update_from_arg_matches to FromArgMatches 2020-11-14 10:17:13 +01:00
Pavan Kumar Sunkara
8d037452c7 Added clap.rs site 2020-11-14 00:39:23 +01:00
bors[bot]
602c79fecd
Merge #2208
2208: Updated changelog and more dep upgrade logic r=pksunkara a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-11-13 02:31:27 +00:00
Pavan Kumar Sunkara
93bad33e48 Updated changelog and more dep upgrade logic 2020-11-13 03:08:09 +01:00
hk
895c903b61 refactor: adding get_global, making two functions private
preserving the observable behavior of the existing 
public api, while handling global arguments separately in 
get_arg_conflicts_with
2020-11-09 15:29:00 +01:00
bors[bot]
022f18278e
Merge #2205
2205: Fix wrong StrictUTF8 handling when AllowExternalSubcommands r=pksunkara a=ldm0



Co-authored-by: ldm0 <ldm2993593805@163.com>
2020-11-08 19:33:23 +00:00
ldm0
ff3b23824d Fix wrong StrictUTF8 handling when AllowExternalSubcommands 2020-11-08 19:06:32 +00:00
ldm0
347cd228a0 Add tests
Fix tests
2020-11-08 19:06:32 +00:00
bors[bot]
3f2eeb5417
Merge #2204
2204: Parser refactor r=pksunkara a=ldm0



Co-authored-by: Donough Liu <ldm2993593805@163.com>
2020-11-08 15:32:29 +00:00
Donough Liu
93b9bd9162 Apply suggestions 2020-11-08 23:06:24 +08:00
Donough Liu
407cdac8e0 Refactor: remove a persistent parser state ValidNegNumFound 2020-11-08 16:05:07 +08:00
Donough Liu
3c2f60c9f3 Remove unreachable branch in use_long_arg() 2020-11-08 16:05:07 +08:00
Donough Liu
7aa2358d6e Simplify is_new_arg() 2020-11-08 16:05:07 +08:00
Donough Liu
b1c7785810 Remove replace variable
Resolve TODO

Small refactors

More descriptive replaced item recovering
2020-11-08 16:05:03 +08:00
bors[bot]
2b68b0f0c7
Merge #2203
2203: Fix suggestions of a subcommand shadowing valid input r=pksunkara a=ldm0



Co-authored-by: Donough Liu <ldm2993593805@163.com>
2020-11-07 13:01:56 +00:00
Donough Liu
5e4b4f4196 Remove invalid suggestion on using subcommand after positional argument 2020-11-07 20:32:28 +08:00
Donough Liu
2b1f47f975 Reduce osstring construction 2020-11-07 16:43:14 +08:00
Donough Liu
020b07b77b Typo fix 2020-11-07 16:43:14 +08:00
Donough Liu
582db739c8 Shrink 2020-11-07 16:43:14 +08:00