Skip to content

Commit 68c4f28

Browse files
authored
Skip adding "--" for action "run"
1 parent e079d3f commit 68c4f28

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎mprof.py‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -918,11 +918,13 @@ def get_profiles(args):
918918
def main():
919919
# Workaround for optparse limitation: insert -- before first negative
920920
# number found.
921-
negint = re.compile("-[0-9]+")
922-
for n, arg in enumerate(sys.argv):
923-
if negint.match(arg):
924-
sys.argv.insert(n, "--")
925-
break
921+
action = get_action()
922+
if action not in ["run"]:
923+
negint = re.compile("-[0-9]+")
924+
for n, arg in enumerate(sys.argv):
925+
if negint.match(arg):
926+
sys.argv.insert(n, "--")
927+
break
926928
actions = {"rm": rm_action,
927929
"clean": clean_action,
928930
"list": list_action,

0 commit comments

Comments
 (0)