From 3bc100aeb3f0763f78c8b3a70165b9f8aaa52db5 Mon Sep 17 00:00:00 2001 From: Eduardo M KALINOWSKI Date: Sat, 16 Feb 2019 18:55:54 -0200 Subject: reverse mode: support wildcard exclude (--exclude-wildcard) This adds support for gitignore-like wildcards and exclude patters in reverse mode. It (somewhat) fixes #273: no regexp support, but the syntax should be powerful enough to satisfy most needs. Also, since adding a lot of --exclude options can be tedious, it adds the --exclude-from option to read patterns from a file (or files). --- cli_args.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cli_args.go') diff --git a/cli_args.go b/cli_args.go index 425730a..c434abb 100644 --- a/cli_args.go +++ b/cli_args.go @@ -36,8 +36,8 @@ type argContainer struct { memprofile, ko, passfile, ctlsock, fsname, force_owner, trace string // -extpass can be passed multiple times extpass multipleStrings - // For reverse mode, -exclude is available. It can be specified multiple times. - exclude multipleStrings + // For reverse mode, several ways to specify exclusions. All can be specified multiple times. + exclude, excludeWildcard, excludeFrom multipleStrings // Configuration file name override config string notifypid, scryptn int @@ -193,9 +193,13 @@ func parseCliOpts() (args argContainer) { flagSet.StringVar(&args.force_owner, "force_owner", "", "uid:gid pair to coerce ownership") flagSet.StringVar(&args.trace, "trace", "", "Write execution trace to file") - // -e, --exclude + // Exclusion options flagSet.Var(&args.exclude, "e", "Alias for -exclude") flagSet.Var(&args.exclude, "exclude", "Exclude relative path from reverse view") + flagSet.Var(&args.excludeWildcard, "ew", "Alias for -exclude-wildcard") + flagSet.Var(&args.excludeWildcard, "exclude-wildcard", "Exclude path from reverse view, supporting wildcards") + flagSet.Var(&args.excludeFrom, "exclude-from", "File from which to read exclusion patterns (with -exclude-wildcard syntax)") + // -extpass flagSet.Var(&args.extpass, "extpass", "Use external program for the password prompt") -- cgit v1.2.3