summaryrefslogtreecommitdiff
path: root/src/leap/util/leap_argparse.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-08-08 09:00:02 +0900
committerkali <kali@leap.se>2012-08-08 09:00:02 +0900
commit01561795251a4eb2255548da22036660cfbf1dda (patch)
tree285d105ec659a2c18f0d544ca9d624283239ed44 /src/leap/util/leap_argparse.py
parent359adbca9dbde07f4054c775650adcd20823f29c (diff)
parentc217bd1f1456cf10ceabf698ea6f4dd8f636f454 (diff)
Merge branch 'ovpn-invocation' into tests-cleanup
Conflicts: .gitignore
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