summaryrefslogtreecommitdiff
path: root/src/leap/util/leap_argparse.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-08-01 09:58:08 +0900
committerkali <kali@leap.se>2012-08-01 09:58:08 +0900
commit6e197c1353c788109df07ee6d1242a5c2327e8f9 (patch)
tree1f87c24b4254f3108177888c9b44d1d5f2c75502 /src/leap/util/leap_argparse.py
parent7cea25f531f46a1425ea54a79d96a3b662a8a7fd (diff)
fileutil.which implementation
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