diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-06-15 13:09:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-15 13:09:37 -0400 |
commit | fa63fd4610fbe4a1d95c4da776e4a1cfa8f8e0b9 (patch) | |
tree | c23b95ed50ed20351b543c900cc970cd9e382ac1 /cli/tools/lint.rs | |
parent | b2e546e530374ca9456aa3f6ff195c3384b32f24 (diff) |
refactor(flags): move watch flags into subcommand structs (#19516)
Moves the watch setting out of the `Flags` struct and into the
individual subcommands
Diffstat (limited to 'cli/tools/lint.rs')
-rw-r--r-- | cli/tools/lint.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs index 9bfe1fd16..4a622f0a0 100644 --- a/cli/tools/lint.rs +++ b/cli/tools/lint.rs @@ -51,18 +51,17 @@ fn create_reporter(kind: LintReporterKind) -> Box<dyn LintReporter + Send> { } pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> { - if flags.watch.is_some() { + if let Some(watch_flags) = &lint_flags.watch { if lint_flags.is_stdin() { return Err(generic_error( "Lint watch on standard input is not supported.", )); } - let clear_screen = !flags.no_clear_screen; file_watcher::watch_func( flags, file_watcher::PrintConfig { job_name: "Lint".to_string(), - clear_screen, + clear_screen: !watch_flags.no_clear_screen, }, move |flags, sender, changed_paths| { let lint_flags = lint_flags.clone(); |