From 6c32f2fe0bdb884574409ef098ea9b31a86504e2 Mon Sep 17 00:00:00 2001 From: Ryan James Spencer Date: Sun, 3 Nov 2019 20:50:44 +1100 Subject: [PATCH 1/2] Integrate .ignore flag from watchexec --- src/args.rs | 7 ++++++- src/lib.rs | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/args.rs b/src/args.rs index e737d70..53268ba 100644 --- a/src/args.rs +++ b/src/args.rs @@ -44,13 +44,18 @@ pub fn parse() -> ArgMatches<'static> { .arg( Arg::with_name("ignore-nothing") .long("ignore-nothing") - .help("Ignore nothing, not even target/ and .git/"), + .help("Ignore nothing, not even target/, .git/, and .ignore"), ) .arg( Arg::with_name("no-gitignore") .long("no-gitignore") .help("Don’t use .gitignore files"), ) + .arg( + Arg::with_name("no-ignore") + .long("no-ignore") + .help("Don’t use .ignore files"), + ) .arg( Arg::with_name("no-restart") .long("no-restart") diff --git a/src/lib.rs b/src/lib.rs index 1329e5a..acd7f1e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,6 +64,7 @@ pub fn set_ignores(debug: bool, builder: &mut ArgsBuilder, matches: &ArgMatches) } builder.no_vcs_ignore(true); + builder.no_ignore(true); return; } @@ -73,6 +74,12 @@ pub fn set_ignores(debug: bool, builder: &mut ArgsBuilder, matches: &ArgMatches) println!(">>> Load Git/VCS ignores: {:?}", !novcs); } + let noignore = matches.is_present("no-ignore"); + builder.no_ignore(noignore); + if debug { + println!(">>> Load .ignore ignores: {:?}", !noignore); + } + let mut list = vec![ // Mac format!("*{}.DS_Store", MAIN_SEPARATOR), From b382240b00e5ec64299327952c58f5a7b1347cd3 Mon Sep 17 00:00:00 2001 From: Ryan James Spencer Date: Mon, 4 Nov 2019 17:39:58 +1100 Subject: [PATCH 2/2] Restore original help text --- src/args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/args.rs b/src/args.rs index 53268ba..19eeb0d 100644 --- a/src/args.rs +++ b/src/args.rs @@ -44,7 +44,7 @@ pub fn parse() -> ArgMatches<'static> { .arg( Arg::with_name("ignore-nothing") .long("ignore-nothing") - .help("Ignore nothing, not even target/, .git/, and .ignore"), + .help("Ignore nothing, not even target/ and .git/"), ) .arg( Arg::with_name("no-gitignore")