Skip to content
Snippets Groups Projects
Commit 58391c90 authored by Matt Traudt's avatar Matt Traudt
Browse files

Add some high-level info to each sbws command --help output

parent e8dc44f8
Branches
Tags
No related merge requests found
......@@ -287,7 +287,12 @@ def test_speedtest(args, conf):
def gen_parser(sub):
sub.add_parser('client', formatter_class=ArgumentDefaultsHelpFormatter)
d = 'The client side of sbws. This should be run on a well-connected '\
'machine on the Internet with a healthy amount of spare bandwidth. '\
'This continuously builds circuits, measures relays, and dumps '\
'results into a datadir, commonly found in ~/.sbws'
sub.add_parser('client', formatter_class=ArgumentDefaultsHelpFormatter,
description=d)
def main(args, conf, log_):
......
......@@ -64,7 +64,10 @@ def scale_lines(args, v3bw_lines):
def gen_parser(sub):
p = sub.add_parser('generate',
d = 'Generate a v3bw file based on recent results. A v3bw file is the '\
'file Tor directory authorities want to read and base their '\
'bandwidth votes on.'
p = sub.add_parser('generate', description=d,
formatter_class=ArgumentDefaultsHelpFormatter)
p.add_argument('--output', default='/dev/stdout', type=str,
help='Where to write v3bw file')
......@@ -84,9 +87,9 @@ def main(args, conf, log_):
datadir = conf['paths']['datadir']
if not os.path.isdir(datadir):
fail_hard(datadir, 'does not exist')
fail_hard(datadir, 'does not exist', log=log)
if args.scale_constant < 1:
fail_hard('--scale-constant must be positive')
fail_hard('--scale-constant must be positive', log=log)
fresh_days = conf.getint('general', 'data_period')
results = load_recent_results_in_datadir(
......
......@@ -6,7 +6,11 @@ import shutil
def gen_parser(sub):
p = sub.add_parser('init', formatter_class=ArgumentDefaultsHelpFormatter)
d = 'Initialize a directory so sbws can use it for configuration, '\
'data storage, etc. A common default directory is ~/.sbws but check '\
'the output of sbws -h to verify.'
p = sub.add_parser('init', formatter_class=ArgumentDefaultsHelpFormatter,
description=d)
def main(args, conf, log_):
......
......@@ -8,7 +8,11 @@ import time
def gen_parser(sub):
sub.add_parser('server', formatter_class=ArgumentDefaultsHelpFormatter)
d = 'The server side of sbws. This should be run on the same machine as '\
'a helper relay. This listens for clients connections and responds '\
'with the number of bytes the client requests.'
sub.add_parser('server', formatter_class=ArgumentDefaultsHelpFormatter,
description=d)
def close_socket(s):
......
......@@ -80,7 +80,9 @@ def print_stats(args, data):
def gen_parser(sub):
p = sub.add_parser('stats', formatter_class=ArgumentDefaultsHelpFormatter)
d = 'Write some statistics about the data collected so far to stdout'
p = sub.add_parser('stats', formatter_class=ArgumentDefaultsHelpFormatter,
description=d)
p.add_argument('--error-types', action='store_true',
help='Also print information about each error type')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment