summaryrefslogtreecommitdiff
path: root/grc/main.py
diff options
context:
space:
mode:
authorJiří Pinkava <j-pi@seznam.cz>2015-10-10 20:56:20 +0200
committerJiří Pinkava <j-pi@seznam.cz>2016-05-03 07:21:30 +0200
commit83411579705f43a30a68df5179fe507398a0555a (patch)
tree90603830286d771a713f08a2b165d77c613717d8 /grc/main.py
parent2b602da7ea6a7ce005e8e9ef371278bcd9ff9ed9 (diff)
grc: gnuradio-companion use ArgumentParser
Diffstat (limited to 'grc/main.py')
-rwxr-xr-xgrc/main.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/grc/main.py b/grc/main.py
index ae7a0ce115..0edab40769 100755
--- a/grc/main.py
+++ b/grc/main.py
@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-import optparse
+import argparse
import gtk
from gnuradio import gr
@@ -34,10 +34,10 @@ This is free software, and you are welcome to redistribute it.
def main():
- parser = optparse.OptionParser(
- usage='usage: %prog [options] [saved flow graphs]',
- version=VERSION_AND_DISCLAIMER_TEMPLATE % gr.version())
- options, args = parser.parse_args()
+ parser = argparse.ArgumentParser(
+ description=VERSION_AND_DISCLAIMER_TEMPLATE % gr.version())
+ parser.add_argument('flow_graphs', nargs='*')
+ args = parser.parse_args()
try:
gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
@@ -50,6 +50,6 @@ def main():
version_parts=(gr.major_version(), gr.api_version(), gr.minor_version()),
install_prefix=gr.prefix()
)
- ActionHandler(args, platform)
+ ActionHandler(args.flow_graphs, platform)
gtk.main()