From c7cddf5ccda132b2babc76ab310840cf232b2950 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Wed, 15 Apr 2015 11:11:55 +0200 Subject: Introduced maintenance command and added reset behaviour. - Call with: pixelated_maintenance reset - Issues #335, #345 --- service/pixelated/config/args.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'service/pixelated/config') diff --git a/service/pixelated/config/args.py b/service/pixelated/config/args.py index d3284fab..7c4f02dc 100644 --- a/service/pixelated/config/args.py +++ b/service/pixelated/config/args.py @@ -20,18 +20,24 @@ from pixelated.bitmask_libraries.config import DEFAULT_LEAP_HOME def parse(): parser = argparse.ArgumentParser(description='Pixelated user agent.') - parser.add_argument('--debug', action='store_true', help='DEBUG mode.') - parser.add_argument('--dispatcher', help='run in organization mode, the credentials will be read from specified file', metavar='file') - parser.add_argument('--dispatcher-stdin', help='run in organization mode, the credentials will be read from stdin', default=False, action='store_true', dest='dispatcher_stdin') + + parser_add_default_arguments(parser) + parser.add_argument('--host', default='127.0.0.1', help='the host to run the user agent on') parser.add_argument('--port', type=int, default=3333, help='the port to run the user agent on') - parser.add_argument('--home', help='The folder where the user agent stores its data. Defaults to ~/.leap', default=DEFAULT_LEAP_HOME) parser.add_argument('-c', '--config', metavar='', default=None, help='use specified file for credentials (for test purposes only)') parser.add_argument('-sk', '--sslkey', metavar='', default=None, help='use specified file as web server\'s SSL key (when using the user-agent together with the pixelated-dispatcher)') parser.add_argument('-sc', '--sslcert', metavar='', default=None, help='use specified file as web server\'s SSL certificate (when using the user-agent together with the pixelated-dispatcher)') - parser.add_argument('-lc', '--leap-cert', metavar='', default=None, help='use specified file for LEAP cert authority certificate (url https:///ca.crt)') - parser.add_argument('--leap-cert-fingerprint', metavar='', default=None, help='use specified fingerprint to validate connection with leap provider', dest='leap_cert_fingerprint') parser.add_argument('--register', metavar=('provider', 'username'), nargs=2, help='register a new username on the desired provider') args = parser.parse_args() return args + + +def parser_add_default_arguments(parser): + parser.add_argument('--debug', action='store_true', help='DEBUG mode.') + parser.add_argument('--dispatcher', help='run in organization mode, the credentials will be read from specified file', metavar='file') + parser.add_argument('--dispatcher-stdin', help='run in organization mode, the credentials will be read from stdin', default=False, action='store_true', dest='dispatcher_stdin') + parser.add_argument('--home', help='The folder where the user agent stores its data. Defaults to ~/.leap', default=DEFAULT_LEAP_HOME) + parser.add_argument('-lc', '--leap-cert', metavar='', default=None, help='use specified file for LEAP cert authority certificate (url https:///ca.crt)') + parser.add_argument('--leap-cert-fingerprint', metavar='', default=None, help='use specified fingerprint to validate connection with leap provider', dest='leap_cert_fingerprint') -- cgit v1.2.3