summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/util/leap_argparse.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-04-04 16:58:18 -0300
committerTomás Touceda <chiiph@leap.se>2014-04-04 16:58:18 -0300
commit81715dc47d77934c4f67d2527a56c28f58f0345d (patch)
tree6e66940af735e089803c5ce05ad1ce1df16c9d1e /src/leap/bitmask/util/leap_argparse.py
parent496036f15cf257d16b6594770812da64a249280c (diff)
parenteb4cdab9c6b8ff66bb4667cc6195d2c366122540 (diff)
Merge branch 'release-0.5.0'0.5.0
Diffstat (limited to 'src/leap/bitmask/util/leap_argparse.py')
-rw-r--r--src/leap/bitmask/util/leap_argparse.py81
1 files changed, 64 insertions, 17 deletions
diff --git a/src/leap/bitmask/util/leap_argparse.py b/src/leap/bitmask/util/leap_argparse.py
index e8a9fda9..88267ff8 100644
--- a/src/leap/bitmask/util/leap_argparse.py
+++ b/src/leap/bitmask/util/leap_argparse.py
@@ -27,30 +27,77 @@ def build_parser():
All the options for the leap arg parser
Some of these could be switched on only if debug flag is present!
"""
- epilog = "Copyright 2012-2013 The LEAP Encryption Access Project"
- parser = argparse.ArgumentParser(description="""
-Launches Bitmask""", epilog=epilog)
+ parser = argparse.ArgumentParser(
+ description="Launches the Bitmask client.",
+ epilog="Copyright 2012-2014 The LEAP Encryption Access Project")
+
parser.add_argument('-d', '--debug', action="store_true",
- help=("Launches Bitmask in debug mode, writing debug"
- "info to stdout"))
- if not IS_RELEASE_VERSION:
- help_text = "Bypasses the certificate check for bootstrap"
- parser.add_argument('--danger', action="store_true", help=help_text)
+ help=("Launches Bitmask in debug mode, writing debug "
+ "info to stdout."))
+ parser.add_argument('-V', '--version', action="store_true",
+ help='Displays Bitmask version and exits.')
+ # files
parser.add_argument('-l', '--logfile', metavar="LOG FILE", nargs='?',
action="store", dest="log_file",
- #type=argparse.FileType('w'),
- help='optional log file')
+ help='Optional log file.')
+ parser.add_argument('-m', '--mail-logfile',
+ metavar="MAIL LOG FILE", nargs='?',
+ action="store", dest="mail_log_file",
+ help='Optional log file for email.')
+
+ # flags
+ parser.add_argument('-s', '--standalone', action="store_true",
+ help='Makes Bitmask use standalone '
+ 'directories for configuration and binary '
+ 'searching.')
+ parser.add_argument('-N', '--no-app-version-check', default=True,
+ action="store_false", dest="app_version_check",
+ help='Skip the app version compatibility check with '
+ 'the provider.')
+ parser.add_argument('-M', '--no-api-version-check', default=True,
+ action="store_false", dest="api_version_check",
+ help='Skip the api version compatibility check with '
+ 'the provider.')
+
+ # openvpn options
parser.add_argument('--openvpn-verbosity', nargs='?',
type=int,
action="store", dest="openvpn_verb",
- help='verbosity level for openvpn logs [1-6]')
- parser.add_argument('-s', '--standalone', action="store_true",
- help='Makes Bitmask use standalone'
- 'directories for configuration and binary'
- 'searching')
- parser.add_argument('-V', '--version', action="store_true",
- help='Displays Bitmask version and exits')
+ help='Verbosity level for openvpn logs [1-6]')
+
+ # mail stuff
+ parser.add_argument('-o', '--offline', action="store_true",
+ help='Starts Bitmask in offline mode: will not '
+ 'try to sync with remote replicas for email.')
+
+ parser.add_argument('--acct', metavar="user@provider",
+ nargs='?',
+ action="store", dest="acct",
+ help='Manipulate mailboxes for this account')
+ parser.add_argument('-r', '--repair-mailboxes', default=False,
+ action="store_true", dest="repair",
+ help='Repair mailboxes for a given account. '
+ 'Use when upgrading versions after a schema '
+ 'change. Use with --acct')
+ parser.add_argument('--import-maildir', metavar="/path/to/Maildir",
+ nargs='?',
+ action="store", dest="import_maildir",
+ help='Import the given maildir. Use with the '
+ '--to-mbox flag to import to folders other '
+ 'than INBOX. Use with --acct')
+
+ if not IS_RELEASE_VERSION:
+ help_text = ("Bypasses the certificate check during provider "
+ "bootstraping, for debugging development servers. "
+ "Use at your own risk!")
+ parser.add_argument('--danger', action="store_true", help=help_text)
+
+ # optional cert file used to check domains with self signed certs.
+ parser.add_argument('--ca-cert-file', metavar="/path/to/cacert.pem",
+ nargs='?', action="store", dest="ca_cert_file",
+ help='Uses the given cert file to verify '
+ 'against domains.')
# Not in use, we might want to reintroduce them.
#parser.add_argument('-i', '--no-provider-checks',