mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +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;
|
||||
*files = canonicalize_files(files)?;
|
||||
|
||||
let skip_questions_positively = if opts.yes {
|
||||
QuestionPolicy::AlwaysYes
|
||||
} else if opts.no {
|
||||
QuestionPolicy::AlwaysNo
|
||||
} else {
|
||||
QuestionPolicy::Ask
|
||||
let skip_questions_positively = match (opts.yes, opts.no) {
|
||||
(false, false) => QuestionPolicy::Ask,
|
||||
(true, false) => QuestionPolicy::AlwaysYes,
|
||||
(false, true) => QuestionPolicy::AlwaysNo,
|
||||
(true, true) => unreachable!(),
|
||||
};
|
||||
|
||||
Ok((opts, skip_questions_positively))
|
||||
|
Loading…
x
Reference in New Issue
Block a user