From 018bffce7cbbdc003ca6f7c9ed6c4422365dd015 Mon Sep 17 00:00:00 2001 From: Daniel Fulton Date: Fri, 13 Dec 2024 10:28:54 -0800 Subject: [PATCH] Disallow abbreviations in the argparse option validity filter --- podman_hpc/click_passthrough.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podman_hpc/click_passthrough.py b/podman_hpc/click_passthrough.py index 5be046c..3d0d74a 100644 --- a/podman_hpc/click_passthrough.py +++ b/podman_hpc/click_passthrough.py @@ -196,7 +196,7 @@ def filterValidOptions(options, subcmd, option_regex=None): option_regex = re.compile(r"^\s*(?:(-\w), )?(--\w[\w\-]+)(?:\s(\w+))?") # create a dummy parser and populate it with valid option flags - p = argparse.ArgumentParser(exit_on_error=False, add_help=False) + p = argparse.ArgumentParser(exit_on_error=False, allow_abbrev=False, add_help=False) with os.popen(" ".join(subcmd)) as f: for line in f: opt = option_regex.match(line)