mirror of
https://github.com/clap-rs/clap
synced 2024-12-12 13:52:34 +00:00
fix: Add back depercated is_multiple_occurrences_set
This commit is contained in:
parent
4cf9f392ae
commit
85b1b7711a
1 changed files with 26 additions and 0 deletions
|
@ -216,6 +216,19 @@ fn gen_options(cmd: &Command, indent: usize) -> String {
|
|||
buffer.push_str(&format!("{:indent$}],\n", "", indent = indent + 4));
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
if matches!(
|
||||
option.get_action(),
|
||||
ArgAction::StoreValue | ArgAction::IncOccurrence
|
||||
) && option.is_multiple_occurrences_set()
|
||||
{
|
||||
buffer.push_str(&format!(
|
||||
"{:indent$}isRepeatable: true,\n",
|
||||
"",
|
||||
indent = indent + 4
|
||||
));
|
||||
}
|
||||
|
||||
if let ArgAction::Set | ArgAction::Append | ArgAction::Count = option.get_action() {
|
||||
buffer.push_str(&format!(
|
||||
"{:indent$}isRepeatable: true,\n",
|
||||
|
@ -303,6 +316,19 @@ fn gen_options(cmd: &Command, indent: usize) -> String {
|
|||
buffer.push_str(&format!("{:indent$}],\n", "", indent = indent + 4));
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
if matches!(
|
||||
flag.get_action(),
|
||||
ArgAction::StoreValue | ArgAction::IncOccurrence
|
||||
) && flag.is_multiple_occurrences_set()
|
||||
{
|
||||
buffer.push_str(&format!(
|
||||
"{:indent$}isRepeatable: true,\n",
|
||||
"",
|
||||
indent = indent + 4
|
||||
));
|
||||
}
|
||||
|
||||
if let ArgAction::Set | ArgAction::Append | ArgAction::Count = flag.get_action() {
|
||||
buffer.push_str(&format!(
|
||||
"{:indent$}isRepeatable: true,\n",
|
||||
|
|
Loading…
Reference in a new issue