Skip to content

Commit e3cbcf0

Browse files
committed
Merge pull request #390 from lrtfm/fix-388
Skip adding "--" for action "run" (Closes #388)
2 parents 99b0651 + 68c4f28 commit e3cbcf0

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
@@ -921,11 +921,13 @@ def get_profiles(args):
921921
def main():
922922
# Workaround for optparse limitation: insert -- before first negative
923923
# number found.
924-
negint = re.compile("-[0-9]+")
925-
for n, arg in enumerate(sys.argv):
926-
if negint.match(arg):
927-
sys.argv.insert(n, "--")
928-
break
924+
action = get_action()
925+
if action not in ["run"]:
926+
negint = re.compile("-[0-9]+")
927+
for n, arg in enumerate(sys.argv):
928+
if negint.match(arg):
929+
sys.argv.insert(n, "--")
930+
break
929931
actions = {"rm": rm_action,
930932
"clean": clean_action,
931933
"list": list_action,

0 commit comments

Comments
 (0)