Skip to content

Commit

Permalink
optimize code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Apr 8, 2024
1 parent 3ee1139 commit b9c6529
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ fn build_parse_flag_option(param: &FlagOptionParam, signs: &str) -> String {
)
};
let (min, max) = param.args_range();
if param.assigned {
let code = if param.assigned {
let not_assigned = if min == 1 {
format!(
r#"
Expand All @@ -563,23 +563,23 @@ fn build_parse_flag_option(param: &FlagOptionParam, signs: &str) -> String {
};
format!(
r#"
{names})
if [[ "$_argc_key" == "$_argc_item" ]]; then{not_assigned}
else
_argc_take_args "{render_name_notations}" {min} {max} "{signs}" "{delimiter}"
fi
_argc_index=$((_argc_index + _argc_take_args_len + 1)){choice}{variant}
;;"#
fi"#
)
} else {
format!(
r#"
{names})
_argc_take_args "{render_name_notations}" {min} {max} "{signs}" "{delimiter}"
_argc_take_args "{render_name_notations}" {min} {max} "{signs}" "{delimiter}""#
)
};
format!(
r#"
{names}){code}
_argc_index=$((_argc_index + _argc_take_args_len + 1)){choice}{variant}
;;"#
)
}
)
}
}

Expand Down

0 comments on commit b9c6529

Please sign in to comment.