diff options
author | Eduardo M KALINOWSKI | 2019-02-16 18:55:54 -0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-03-26 20:56:37 +0100 |
commit | 3bc100aeb3f0763f78c8b3a70165b9f8aaa52db5 (patch) | |
tree | 19b1576b0ee8e74612c29b0ff4cec4f3cecf2b29 /cli_args.go | |
parent | 73f9e2374dab47374dc479911a9be5cfebf89378 (diff) |
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).
Diffstat (limited to 'cli_args.go')
-rw-r--r-- | cli_args.go | 10 |
1 files changed, 7 insertions, 3 deletions
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") |