From b3f81e68440227afa0f143bfc907cea8e6b06707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel?= <1024mb@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:04:14 -0500 Subject: [PATCH] better messages, added warning when --ef is used with empty values --- save-file-attrs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/save-file-attrs.py b/save-file-attrs.py index 8365e35..e40bf8e 100755 --- a/save-file-attrs.py +++ b/save-file-attrs.py @@ -745,14 +745,18 @@ def main(): if args.mode == "save": if args.ed is not None: if len(args.ed) == 0 or "" in args.ed: - print("ERROR: Directory exclusion can't be empty or else everything will be excluded, aborting...", + print("ERROR: Directory exclusion can't be empty or have an empty value or else everything will be " + "excluded, aborting...", file=sys.stderr) sys.exit(3) if args.ex is not None: if len(args.ex) == 0 or "" in args.ex: - print("ERROR: Exclusion can't be empty or else everything will be excluded, aborting...", + print("ERROR: Exclusion can't be empty or have an empty value or else everything will be excluded, " + "aborting...", file=sys.stderr) sys.exit(3) + if args.ef is not None and "" in args.ef: + print("WARNING: You have used an empty value for file exclusions, every file will be excluded.") if args.ex is not None and (args.ef or args.ed) is not None: print("ERROR: You can't use --ex with --ef or --ed, you should use --ef and --ed or use only one of them", file=sys.stderr)