From d43bc673ef0f62c4e6a4c0b9b442a65e9a481a95 Mon Sep 17 00:00:00 2001 From: Mike Pennington Date: Wed, 16 Aug 2023 07:00:30 -0500 Subject: [PATCH 1/3] Add -E as shortcut for --exclude-pattern This is a time-saver to avoid '--exclude-pattern' spam if you need to exclude matching on a lot of character patters --- psslib/pss.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/psslib/pss.py b/psslib/pss.py index 972f5f3..bc74ca1 100644 --- a/psslib/pss.py +++ b/psslib/pss.py @@ -1,3 +1,4 @@ + #------------------------------------------------------------------------------- # pss: pss.py # @@ -349,7 +350,7 @@ def parse_cmdline(cmdline_args): group_inclusion.add_option('-G', '--include-pattern', action='append', dest='include_patterns', metavar='REGEX', default=[], help='Only search files that match REGEX') - group_inclusion.add_option('--exclude-pattern', + group_inclusion.add_option('-E', '--exclude-pattern', action='append', dest='exclude_patterns', metavar='REGEX', default=[], help='Exclude files that match REGEX') optparser.add_option_group(group_inclusion) From d380e2e04b197902ebab61a7355a27e008ad018b Mon Sep 17 00:00:00 2001 From: Mike Pennington Date: Thu, 17 Aug 2023 05:38:26 -0500 Subject: [PATCH 2/3] TEST: Add '-E' option as alias for '--exclude-pattern' --- test/test_pssmain.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_pssmain.py b/test/test_pssmain.py index 762ee25..b9b722d 100644 --- a/test/test_pssmain.py +++ b/test/test_pssmain.py @@ -402,6 +402,10 @@ def test_only_find_files_GGG(self): ]) def test_only_find_files_exclude_pattern(self): + self._run_main(['--cc', '-f', '-E', 'ea']) + self.assertFoundFiles(self.of, + ['testdir1/subdir1/filey.c', + 'testdir1/subdir1/filez.c']) self._run_main(['--cc', '-f', '--exclude-pattern', 'ea']) self.assertFoundFiles(self.of, ['testdir1/subdir1/filey.c', From 5ae3ecec625d2e351023aaf5fd8d67341bc53d1a Mon Sep 17 00:00:00 2001 From: Mike Pennington Date: Thu, 17 Aug 2023 23:32:14 -0500 Subject: [PATCH 3/3] Update pss.py --- psslib/pss.py | 1 - 1 file changed, 1 deletion(-) diff --git a/psslib/pss.py b/psslib/pss.py index bc74ca1..e20d092 100644 --- a/psslib/pss.py +++ b/psslib/pss.py @@ -1,4 +1,3 @@ - #------------------------------------------------------------------------------- # pss: pss.py #