From 4fd8b203fdcff3d42c6d15a295f35a59ab1f2cc8 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Sat, 27 Mar 2021 15:04:24 -0700 Subject: [PATCH] chore: add --exact (-e) to x.py to pick a single target exactly --- x.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x.py b/x.py index 67e2099f..9e1c6ebb 100755 --- a/x.py +++ b/x.py @@ -11,6 +11,7 @@ from subprocess import check_call, check_output, PIPE parser = argparse.ArgumentParser() parser.add_argument("-v", "--verbose", action="store_true") parser.add_argument("-q", "--quiet", action="store_true") +parser.add_argument("-e", "--exact", action="store_true") parser.add_argument("target", nargs="?") parser.add_argument("-l", "--list-targets", action="store_true") parser.add_argument("--coverage", action="store_true") @@ -33,6 +34,10 @@ def should_run(tag): return False if argv.target is not None: + if argv.exact: + if argv.target != tag: + return False + if not re.match(argv.target.replace("_", ".*?"), tag): return False