mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +00:00
Merge pull request #4128 from epage/default
fix(derive): Remove error case for default_value
This commit is contained in:
commit
2f4e42f227
3 changed files with 0 additions and 35 deletions
|
@ -161,12 +161,6 @@ impl Parse for ClapAttr {
|
||||||
"external_subcommand" => Ok(ExternalSubcommand(name)),
|
"external_subcommand" => Ok(ExternalSubcommand(name)),
|
||||||
"verbatim_doc_comment" => Ok(VerbatimDocComment(name)),
|
"verbatim_doc_comment" => Ok(VerbatimDocComment(name)),
|
||||||
|
|
||||||
"default_value" => {
|
|
||||||
abort!(name,
|
|
||||||
"`#[clap(default_value)` attribute (without a value) has been replaced by `#[clap(default_value_t)]`.";
|
|
||||||
help = "Change the attribute to `#[clap(default_value_t)]`";
|
|
||||||
)
|
|
||||||
}
|
|
||||||
"default_value_t" => Ok(DefaultValueT(name, None)),
|
"default_value_t" => Ok(DefaultValueT(name, None)),
|
||||||
"default_value_os_t" => Ok(DefaultValueOsT(name, None)),
|
"default_value_os_t" => Ok(DefaultValueOsT(name, None)),
|
||||||
"about" => (Ok(About(name))),
|
"about" => (Ok(About(name))),
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
// Copyright 2018 Guillaume Pinot (@TeXitoi) <texitoi@texitoi.eu>
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
use clap::Parser;
|
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
|
||||||
#[clap(name = "basic")]
|
|
||||||
struct Opt {
|
|
||||||
#[clap(default_value)]
|
|
||||||
value: i32,
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let opt = Opt::parse();
|
|
||||||
println!("{:?}", opt);
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
error: `#[clap(default_value)` attribute (without a value) has been replaced by `#[clap(default_value_t)]`.
|
|
||||||
|
|
||||||
= help: Change the attribute to `#[clap(default_value_t)]`
|
|
||||||
|
|
||||||
--> tests/derive_ui/default_value_wo_value_removed.rs:14:12
|
|
||||||
|
|
|
||||||
14 | #[clap(default_value)]
|
|
||||||
| ^^^^^^^^^^^^^
|
|
Loading…
Add table
Reference in a new issue