Merge pull request #13 from palfrey/12-run-initially

Option to run command initially, before first file change
This commit is contained in:
Matt Green 2016-10-18 18:05:14 -04:00 committed by GitHub
commit f1597cc1a6
1 changed files with 7 additions and 0 deletions

View File

@ -71,6 +71,9 @@ fn get_args<'a>() -> ArgMatches<'a> {
.arg(Arg::with_name("no-vcs-ignore")
.help("Skip auto-loading of .gitignore files for filtering")
.long("no-vcs-ignore"))
.arg(Arg::with_name("run-initially")
.help("Run command initially, before first file change")
.long("run-initially"))
.get_matches()
}
@ -153,6 +156,10 @@ fn main() {
let cmd = cmd_parts.join(" ");
let mut runner = Runner::new(args.is_present("restart"), args.is_present("clear"));
if args.is_present("run-initially") {
runner.run_command(&cmd);
}
loop {
let e = wait(&rx, &filter).expect("error when waiting for filesystem changes");