mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 20:15:27 +00:00
Merge pull request #221 from ouch-org/flags-no-yes-redundancy-check
Add redundant check for --yes and --no flags conflict
This commit is contained in:
commit
b50987840e
11
src/cli.rs
11
src/cli.rs
@ -33,12 +33,11 @@ impl Opts {
|
|||||||
| Subcommand::List { archives: files, .. }) = &mut opts.cmd;
|
| Subcommand::List { archives: files, .. }) = &mut opts.cmd;
|
||||||
*files = canonicalize_files(files)?;
|
*files = canonicalize_files(files)?;
|
||||||
|
|
||||||
let skip_questions_positively = if opts.yes {
|
let skip_questions_positively = match (opts.yes, opts.no) {
|
||||||
QuestionPolicy::AlwaysYes
|
(false, false) => QuestionPolicy::Ask,
|
||||||
} else if opts.no {
|
(true, false) => QuestionPolicy::AlwaysYes,
|
||||||
QuestionPolicy::AlwaysNo
|
(false, true) => QuestionPolicy::AlwaysNo,
|
||||||
} else {
|
(true, true) => unreachable!(),
|
||||||
QuestionPolicy::Ask
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok((opts, skip_questions_positively))
|
Ok((opts, skip_questions_positively))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user