From 68c4f28438e89fda1a353d99a10eb8693eab19ad Mon Sep 17 00:00:00 2001 From: Yang Zongze Date: Mon, 10 Apr 2023 21:59:50 +0800 Subject: [PATCH] Skip adding "--" for action "run" --- mprof.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mprof.py b/mprof.py index 7753d7e..f0c0a27 100644 --- a/mprof.py +++ b/mprof.py @@ -918,11 +918,13 @@ def get_profiles(args): def main(): # Workaround for optparse limitation: insert -- before first negative # number found. - negint = re.compile("-[0-9]+") - for n, arg in enumerate(sys.argv): - if negint.match(arg): - sys.argv.insert(n, "--") - break + action = get_action() + if action not in ["run"]: + negint = re.compile("-[0-9]+") + for n, arg in enumerate(sys.argv): + if negint.match(arg): + sys.argv.insert(n, "--") + break actions = {"rm": rm_action, "clean": clean_action, "list": list_action,