mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-17 01:28:30 +01:00
aae5a216b0
Instead of special-casing the callback, which is the path least-taken, switch the internals to a Handler model, where the default behaviour is an implementation of a Handler, and external callers can implement their own Handlers and pass them in. While doing so, change all unwraps in run::run to returning Errs, and expand the watchexec Error enum to accommodate. That should make it easier to use as a library. Also, differentiate between "manual" and "on update" runs. For now the only manual run is the initial run, but this paves the way for e.g. keyboard- or signal- triggered runs.
6 lines
120 B
Rust
6 lines
120 B
Rust
extern crate watchexec;
|
|
use watchexec::{cli, error, run};
|
|
|
|
fn main() -> error::Result<()> {
|
|
run(cli::get_args()?)
|
|
}
|