fix: Add back depercated is_multiple_occurrences_set

This commit is contained in:
grant0417 2022-07-01 11:48:56 -07:00
parent 4cf9f392ae
commit 85b1b7711a

View file

@ -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",