summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Pinkava <j-pi@seznam.cz>2015-10-10 20:44:05 +0200
committerJiří Pinkava <j-pi@seznam.cz>2016-05-02 12:28:10 +0200
commit2b602da7ea6a7ce005e8e9ef371278bcd9ff9ed9 (patch)
tree849e3bf403856e9554e8d66bdd556cbccedf7230
parent55ceb2e5c1356f2438908d0e28617cd748291fe7 (diff)
examples: plot_flops use ArgumentParser
-rwxr-xr-xgnuradio-runtime/examples/mp-sched/plot_flops.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/gnuradio-runtime/examples/mp-sched/plot_flops.py b/gnuradio-runtime/examples/mp-sched/plot_flops.py
index d9d810ae2f..c80820b8a3 100755
--- a/gnuradio-runtime/examples/mp-sched/plot_flops.py
+++ b/gnuradio-runtime/examples/mp-sched/plot_flops.py
@@ -28,7 +28,7 @@ import re
import sys
import os
import tempfile
-from optparse import OptionParser
+from argparse import ArgumentParser
def parse_file(input_filename, output):
@@ -84,14 +84,11 @@ def handle_file(input_filename):
def main():
- usage = "usage: %prog [options] file.dat"
- parser = OptionParser(usage=usage)
- (options, args) = parser.parse_args()
- if len(args) != 1:
- parser.print_help()
- raise SystemExit, 1
-
- handle_file(args[0])
+ parser = ArgumentParser()
+ parser.add_argument('file', help='Input file', nargs=1)
+ args = parser.parse_args()
+
+ handle_file(args.file[0])
if __name__ == '__main__':