Skip to content

Commit

Permalink
fix: add accept all
Browse files Browse the repository at this point in the history
  • Loading branch information
HerringtonDarkholme committed Dec 29, 2022
1 parent 69ff722 commit 5670bb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/cli/src/print/interactive_print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct InteractivePrinter {
inner: ColoredPrinter,
}
impl InteractivePrinter {
pub fn new() -> Self {
pub fn new(accept_all: bool) -> Self {
Self {
accept_all: false,
inner: ColoredPrinter::color(codespan_reporting::term::termcolor::ColorChoice::Auto),
Expand Down
6 changes: 4 additions & 2 deletions crates/cli/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ pub struct ScanArg {
pub fn run_with_pattern(arg: RunArg) -> Result<()> {
let interactive = arg.interactive || arg.accept_all;
if interactive {
run_pattern_with_printer(arg, InteractivePrinter::new())
let printer = InteractivePrinter::new(arg.accept_all);
run_pattern_with_printer(arg, printer)
} else if arg.json {
run_pattern_with_printer(arg, JSONPrinter::new())
} else {
Expand Down Expand Up @@ -223,7 +224,8 @@ impl<P: Printer + Sync> Worker for RunWithSpecificLang<P> {
pub fn run_with_config(arg: ScanArg) -> Result<()> {
let interactive = arg.interactive || arg.accept_all;
if interactive {
let worker = ScanWithConfig::try_new(arg, InteractivePrinter::new())?;
let printer = InteractivePrinter::new(arg.accept_all);
let worker = ScanWithConfig::try_new(arg, printer)?;
run_worker(worker)
} else if arg.json {
let worker = ScanWithConfig::try_new(arg, JSONPrinter::new())?;
Expand Down

0 comments on commit 5670bb6

Please sign in to comment.