summaryrefslogtreecommitdiff
path: root/src/leap/utils/leap_argparse.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-07-22 21:10:15 -0700
committerkali <kali@leap.se>2012-07-22 21:10:15 -0700
commitc46d8da153ac658c8bd145376e22b1218db1090a (patch)
tree0943a4a866d9f3b1bc590c1c23f810ca13635f9e /src/leap/utils/leap_argparse.py
initial import
Diffstat (limited to 'src/leap/utils/leap_argparse.py')
-rw-r--r--src/leap/utils/leap_argparse.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/leap/utils/leap_argparse.py b/src/leap/utils/leap_argparse.py
new file mode 100644
index 00000000..9c355134
--- /dev/null
+++ b/src/leap/utils/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