mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
Merge #2941
2941: Fix a path incompatible with re-exports r=pksunkara a=epage Co-authored-by: Ed Page <eopage@gmail.com>
This commit is contained in:
commit
d6462884ed
2 changed files with 11 additions and 1 deletions
10
clap_derive/CONTRIBUTING.md
Normal file
10
clap_derive/CONTRIBUTING.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# How to Contribute
|
||||
|
||||
See the [clap-wide CONTRIBUTING.md](../CONTRIBUTING.md). This will contain `clap_derive` specific notes.
|
||||
|
||||
## Derive Gotchas
|
||||
|
||||
- Always prefix generated variables with `__clap_` to minimize clashes with the user's variables, see [#2934](https://github.com/clap-rs/clap/issues/2934).
|
||||
- Prefer the path `clap` over `::clap` to allow users to re-export clap, see [#2258](https://github.com/clap-rs/clap/pull/2258).
|
||||
- Prefer substituting variable names to avoid problems with `macro_rules`, see [#2823](https://github.com/clap-rs/clap/pull/2823).
|
||||
- Put whitespace between `#quoted #variables`.
|
|
@ -231,7 +231,7 @@ fn gen_augment(
|
|||
let #subcommand_var = clap::App::new(#name);
|
||||
let #subcommand_var = #subcommand_var #initial_app_methods;
|
||||
let #subcommand_var = #arg_block;
|
||||
let #subcommand_var = #subcommand_var.setting(::clap::AppSettings::SubcommandRequiredElseHelp);
|
||||
let #subcommand_var = #subcommand_var.setting(clap::AppSettings::SubcommandRequiredElseHelp);
|
||||
#subcommand_var #final_from_attrs
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue