From ec00353eaec71d98148c89a757e7059926ae9093 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Tue, 9 Jun 2015 23:34:29 -0400 Subject: [PATCH] adjust wording of usage and help messages --- bin/wee_config | 41 ++++++++++++++++++++--------------------- bin/weecfg/config.py | 2 +- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/bin/wee_config b/bin/wee_config index cbd4cd04..7691b07e 100755 --- a/bin/wee_config +++ b/bin/wee_config @@ -20,15 +20,15 @@ usage = """Usage: wee_config --help [--driver=DRIVER] [--units=(us|metric)] [--latitude=yy.y] [--longitude=xx.x] [--altitude=zz.z,(foot|meter)] [--location="Home Sweet Home"] - [--no-prompt] + [--no-prompt] [--no-backup] wee_config --upgrade CONFIG_FILE|--config=CONFIG_FILE --dist-config=DIST_CONFIG - [--output=OUT_CONFIG] [--no-prompt] [--warn-on-error] + [--output=OUT_CONFIG] [--no-prompt] [--no-backup] [--warn-on-error] wee_config --reconfigure CONFIG_FILE|--config=CONFIG_FILE [--driver=DRIVER] [--units=(us|metric)] [--latitude=yy.y] [--longitude=xx.x] [--altitude=zz.z,(foot|meter)] [--location="Home Sweet Home"] - [--output=OUT_CONFIG] [--no-prompt] + [--output=OUT_CONFIG] [--no-prompt] [--no-backup] Commands: @@ -36,16 +36,16 @@ Commands: --version Show the weewx version then exit. --list-drivers List the available weewx device drivers, then exit. --install Install a new configuration file starting with the contents of - DIST_CONFIG, prompting as necessary. Can take command-line - station values, including a driver. + DIST_CONFIG, prompting as necessary. --upgrade Update the contents of configuration file CONFIG_FILE to the - installer version, then merge the result with the - contents of configuration file DIST_CONFIG. ---reconfigure Modify an existing configuration file CONFIG_FILE. Can take command-line - station values, including a driver. Use this command to add a driver. + installer version, then merge the result with the contents of + configuration file DIST_CONFIG. +--reconfigure Modify an existing configuration file CONFIG_FILE with any + specified station parameters. Use this command with the + driver option to change the device driver. -Command-line "station" values: - If given, the value will replace what's in CONFIG_FILE. +Station parameters: + If specified, the value will replace what is in CONFIG_FILE. --driver --units --latitude --longitude --altitude --location @@ -68,16 +68,16 @@ def main(): help="Install a new configuration file.") parser.add_option("--upgrade", action="store_true", help="Update an existing configuration file, then merge " - "with a DIST_CONFIG.") + "with contents of DIST_CONFIG.") parser.add_option("--reconfigure", action="store_true", help="Reconfigure an existing configuration file.") parser.add_option("--config", dest="config_path", metavar="CONFIG_FILE", help="Use configuration file CONFIG_FILE.") parser.add_option("--dist-config", - help="Use new/template configuration file DIST_CONFIG.") + help="Use template configuration file DIST_CONFIG.") parser.add_option("--output", metavar="OUT_CONFIG", - help="Save to configuration file OUT_CONFIG. If not given, " - "then replace existing configuration file.") + help="Save to configuration file OUT_CONFIG. If not " + "specified then replace existing configuration file.") parser.add_option("--driver", metavar="DRIVER", help="Use the driver DRIVER. " "For example, weewx.driver.vantage") @@ -94,14 +94,13 @@ def main(): parser.add_option("--units", choices=["us", "metric"], metavar="(metric|us)", help="Set display units to 'metric' or 'us'.") parser.add_option("--no-prompt", action="store_true", - help="Do not prompt. Use default or command-line " - "station values only.") + help="Do not prompt. Use default or specified values.") parser.add_option("--no-backup", action="store_true", default=False, - help="If replacing an existing configuration file, " - "do not backup first.") + help="When replacing an existing configuration file, " + "do not create a backup copy.") parser.add_option("--warn-on-error", action="store_true", default=False, - help="Warn if an update is not possible. " - "Otherwise, die (the default).") + help="Only warn if an update is not possible. Default " + "behavior is to warn then exit.") parser.add_option("--debug", action="store_true", help="Show diagnostic information while running.") diff --git a/bin/weecfg/config.py b/bin/weecfg/config.py index 79482201..73638170 100644 --- a/bin/weecfg/config.py +++ b/bin/weecfg/config.py @@ -44,7 +44,7 @@ class ConfigEngine(object): # Check for missing --dist-config if (options.install or options.upgrade) and not options.dist_config: - sys.exit("The commands --install or --upgrade require option --dist-config.") + sys.exit("The commands --install and --upgrade require option --dist-config.") if options.install and not options.output: sys.exit("The --install command requires option --output.")