diff libervia/server/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 45ebeea1bacd
children 10517a8698ca
line wrap: on
line diff
--- a/libervia/server/server.py	Sun Nov 15 16:59:55 2020 +0100
+++ b/libervia/server/server.py	Fri Nov 20 17:53:01 2020 +0100
@@ -1052,7 +1052,7 @@
         log.info(f"Libervia v{self.full_version}")
 
         # settings
-        if self.options['dev_mode']:
+        if self.options['dev-mode']:
             log.info(_("Developer mode activated"))
         self.media_dir = await self.bridgeCall("getConfig", "", "media_dir")
         self.local_dir = await self.bridgeCall("getConfig", "", "local_dir")
@@ -1083,7 +1083,7 @@
         self.sat_root = default_root = LiberviaRootResource(
             host=self, host_name='', site_name='',
             site_path=default_site_path, path=root_path)
-        if self.options['dev_mode']:
+        if self.options['dev-mode']:
             self.files_watcher.watchDir(
                 default_site_path, auto_add=True, recursive=True,
                 callback=LiberviaPage.onFileChange, site_root=self.sat_root,
@@ -1129,7 +1129,7 @@
 
                 existing_vhosts[encoded_site_name] = res
 
-                if self.options['dev_mode']:
+                if self.options['dev-mode']:
                     self.files_watcher.watchDir(
                         site_path, auto_add=True, recursive=True,
                         callback=LiberviaPage.onFileChange, site_root=res,