Mercurial > libervia-web
diff twisted/plugins/libervia_server.py @ 1364:df40708c4c76
server: renamed `--dev_mode` to `--dev-mode` and set it as a flag:
good practice is to use a dash instead of underscode for CLI arguments.
This options is actually a flag, no need to specify the value.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 20 Nov 2020 17:53:01 +0100 |
parents | c3dac1e11341 |
children | 10517a8698ca |
line wrap: on
line diff
--- a/twisted/plugins/libervia_server.py Sun Nov 15 16:59:55 2020 +0100 +++ b/twisted/plugins/libervia_server.py Fri Nov 20 17:53:01 2020 +0100 @@ -131,8 +131,6 @@ ['base_url_ext', '', '', _('The external URL to use as base URL').encode('utf-8'), coerceUnicode], - ['dev_mode', 'D', False, _('Developer mode, automatically reload ' - 'modified pages').encode('utf-8'), coerceBool], ] # Options which are in sat.conf only OPT_PARAMETERS_CFG = [ @@ -145,6 +143,12 @@ ["mr_handlers_json", None, None, None], ] +# Flags are in command line only +OPT_FLAGS = [ + ['dev-mode', 'D', _('Developer mode, automatically reload modified pages')], +] + + def initialise(options): """Method to initialise global modules""" @@ -166,6 +170,7 @@ class Options(usage.Options): # optArgs is not really useful in our case, we need more than a flag optParameters = OPT_PARAMETERS_BOTH + optFlags = OPT_FLAGS def __init__(self): """Read SàT configuration file in order to overwrite the hard-coded default values