Skip to content

Commit 2b2b112

Browse files
committed
Fix positional arg parsing.
Fixes #111
1 parent 54a997b commit 2b2b112

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gprof2dot.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,9 +3636,9 @@ def main(argv=sys.argv[1:]):
36363636
labelNames.sort()
36373637

36383638
argparser = argparse.ArgumentParser(
3639-
usage="\n %(prog)s [options] [file] ...")
3639+
usage="\n %(prog)s [options] [INPUT] ...")
36403640
argparser.add_argument(
3641-
'-o', '--output', metavar='FILE',
3641+
'-o', '--output', metavar='OUTPUT',
36423642
dest="output",
36433643
help="output filename [stdout]")
36443644
argparser.add_argument(
@@ -3763,7 +3763,9 @@ def main(argv=sys.argv[1:]):
37633763
dest="color_by_difference", default=False,
37643764
help="color nodes based on the value of the difference. "
37653765
"Nodes with the largest differences represent the hot spots.")
3766-
(options, args) = argparser.parse_args(argv)
3766+
argparser.add_argument('input', nargs='+', metavar='INPUT', help='input stats')
3767+
options = argparser.parse_args(argv)
3768+
args = options.input
37673769

37683770
if len(args) > 1 and options.format != 'pstats' and not options.compare:
37693771
argparser.error('incorrect number of arguments')

0 commit comments

Comments
 (0)