Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/uu/split/src/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ fn handle_preceding_options(
preceding_long_opt_req_value: &mut bool,
preceding_short_opt_req_value: &mut bool,
) {
*preceding_short_opt_req_value = false;
*preceding_long_opt_req_value = false;

// capture if current slice is a preceding long option that requires value and does not use '=' to assign that value
// following slice should be treaded as value for this option
// even if it starts with '-' (which would be treated as hyphen prefixed value)
Expand All @@ -226,12 +229,6 @@ fn handle_preceding_options(
// following slice should be treaded as value for this option
// even if it starts with '-' (which would be treated as hyphen prefixed value)
*preceding_short_opt_req_value = matches!(slice, "-b" | "-C" | "-l" | "-n" | "-a" | "-t");
// slice is a value
// reset preceding option flags
if !slice.starts_with('-') {
*preceding_short_opt_req_value = false;
*preceding_long_opt_req_value = false;
}
}

pub fn uu_app() -> Command {
Expand Down
Loading