mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-05 23:47:46 +00:00
Fixed invert issue
This commit is contained in:
parent
b612ce5cd7
commit
03578a7aca
1 changed files with 5 additions and 5 deletions
|
@ -91,11 +91,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
let force_prompt_never: bool = force_flag && {
|
||||
if matches.value_source(OPT_FORCE) == Some(ValueSource::CommandLine) {
|
||||
let force_index = matches.index_of(OPT_FORCE).unwrap_or(0);
|
||||
[OPT_PROMPT, OPT_PROMPT_MORE, OPT_INTERACTIVE]
|
||||
![OPT_PROMPT, OPT_PROMPT_MORE, OPT_INTERACTIVE]
|
||||
.iter()
|
||||
.any(|opt| {
|
||||
matches.value_source(opt) == Some(ValueSource::CommandLine)
|
||||
&& matches.index_of(opt).unwrap_or(0) < force_index
|
||||
.any(|flag| {
|
||||
matches.value_source(flag) == Some(ValueSource::CommandLine)
|
||||
&& matches.index_of(flag).unwrap_or(0) > force_index
|
||||
})
|
||||
} else {
|
||||
false
|
||||
|
@ -110,7 +110,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
let options = Options {
|
||||
force: force_flag,
|
||||
interactive: {
|
||||
if force_flag && force_prompt_never {
|
||||
if force_prompt_never {
|
||||
InteractiveMode::Never
|
||||
} else if matches.get_flag(OPT_PROMPT) {
|
||||
InteractiveMode::Always
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue