summaryrefslogtreecommitdiff
path: root/src/leap/util/leap_argparse.py
diff options
context:
space:
mode:
authorantialias <antialias@leap.se>2012-08-14 13:41:01 -0700
committerantialias <antialias@leap.se>2012-08-14 13:41:01 -0700
commitbc44a763808241ec4e732e7b3bbd819490c88cbb (patch)
treea55f7c670dbd051981ce65c37da5320a5e980990 /src/leap/util/leap_argparse.py
parente1103904fbdd9b54b53075956c279271c17e9a8f (diff)
parentb0ef9f98d8384cb68e59fac91142e5ac9f2ab47c (diff)
Merge branch 'develop' of ssh://leap.se:4422/leap-client into refactor
Diffstat (limited to 'src/leap/util/leap_argparse.py')
-rw-r--r--src/leap/util/leap_argparse.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/leap/util/leap_argparse.py b/src/leap/util/leap_argparse.py
new file mode 100644
index 00000000..9c355134
--- /dev/null
+++ b/src/leap/util/leap_argparse.py
@@ -0,0 +1,20 @@
+import argparse
+
+
+def build_parser():
+ epilog = "Copyright 2012 The Leap Project"
+ parser = argparse.ArgumentParser(description="""
+Launches main LEAP Client""", epilog=epilog)
+ parser.add_argument('--debug', action="store_true",
+ help='launches in debug mode')
+ parser.add_argument('--config', metavar="CONFIG FILE", nargs='?',
+ action="store", dest="config_file",
+ type=argparse.FileType('r'),
+ help='optional config file')
+ return parser
+
+
+def init_leapc_args():
+ parser = build_parser()
+ opts = parser.parse_args()
+ return parser, opts