add --quiet flag to watch
command
This commit is contained in:
parent
dbd60ed4f4
commit
b4ffdff026
|
@ -61,6 +61,7 @@ impl Command for Watch {
|
||||||
"Watch all directories under `<path>` recursively. Will be ignored if `<path>` is a file (default: true)",
|
"Watch all directories under `<path>` recursively. Will be ignored if `<path>` is a file (default: true)",
|
||||||
Some('r'),
|
Some('r'),
|
||||||
)
|
)
|
||||||
|
.switch("quiet", "Hide the initial status message (default: false)", Some('q'))
|
||||||
.switch("verbose", "Operate in verbose mode (default: false)", Some('v'))
|
.switch("verbose", "Operate in verbose mode (default: false)", Some('v'))
|
||||||
.category(Category::FileSystem)
|
.category(Category::FileSystem)
|
||||||
}
|
}
|
||||||
|
@ -94,6 +95,8 @@ impl Command for Watch {
|
||||||
|
|
||||||
let verbose = call.has_flag(engine_state, stack, "verbose")?;
|
let verbose = call.has_flag(engine_state, stack, "verbose")?;
|
||||||
|
|
||||||
|
let quiet = call.has_flag(engine_state, stack, "quiet")?;
|
||||||
|
|
||||||
let debounce_duration_flag: Option<Spanned<i64>> =
|
let debounce_duration_flag: Option<Spanned<i64>> =
|
||||||
call.get_flag(engine_state, stack, "debounce-ms")?;
|
call.get_flag(engine_state, stack, "debounce-ms")?;
|
||||||
let debounce_duration = match debounce_duration_flag {
|
let debounce_duration = match debounce_duration_flag {
|
||||||
|
@ -161,7 +164,9 @@ impl Command for Watch {
|
||||||
// need to cache to make sure that rename event works.
|
// need to cache to make sure that rename event works.
|
||||||
debouncer.cache().add_root(&path, recursive_mode);
|
debouncer.cache().add_root(&path, recursive_mode);
|
||||||
|
|
||||||
|
if !quiet {
|
||||||
eprintln!("Now watching files at {path:?}. Press ctrl+c to abort.");
|
eprintln!("Now watching files at {path:?}. Press ctrl+c to abort.");
|
||||||
|
}
|
||||||
|
|
||||||
let mut closure = ClosureEval::new(engine_state, stack, closure);
|
let mut closure = ClosureEval::new(engine_state, stack, closure);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user