Skip to content

Commit 42f683f

Browse files
committed
Merge pull request #93 from shyba/fix/help-messages
Fix/help messages
2 parents 6694c53 + 05e9714 commit 42f683f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

mprof

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ def plot_action():
431431
"mprofile_*.dat files, generated by the "
432432
"'mprof run' command.")
433433
sys.exit(-1)
434+
print("Using last profile data.")
434435
filenames = [profiles[-1]]
435436
else:
436437
filenames = []
@@ -441,10 +442,13 @@ def plot_action():
441442
else:
442443
try:
443444
n = int(arg)
445+
if not profiles[n] in filenames:
446+
filenames.append(profiles[n])
444447
except ValueError:
445448
print("Input file not found: " + arg)
446-
if not profiles[n] in filenames:
447-
filenames.append(profiles[n])
449+
if not len(filenames):
450+
print("No files found from given input.")
451+
sys.exit(-1)
448452

449453
pl.figure(figsize=(14, 6), dpi=90)
450454
if len(filenames) > 1 or options.no_timestamps:

0 commit comments

Comments
 (0)