Add a --no-daemon option
authorChristophe de Vienne <christophe@unlish.com>
Fri, 19 Sep 2014 19:55:33 +0200
changeset 11641 3d4e7be2e3c3
parent 11640 e45e4999dc98
child 11642 3defbb0f147a
Add a --no-daemon option
ccplugin.py
--- a/ccplugin.py	Fri Sep 19 19:20:35 2014 +0200
+++ b/ccplugin.py	Fri Sep 19 19:55:33 2014 +0200
@@ -37,9 +37,13 @@
     name = 'pyramid'
 
     options = (
-        ("debug",
+        ('no-daemon',
+         {'action': 'store_true',
+          'help': 'Run the server in the foreground.'}),
+        ('debug',
          {'short': 'D', 'action': 'store_true',
-          'help': 'start server in the foreground.'}),
+          'help': 'Activate the debug tools and '
+                  'run the server in the foreground.'}),
         ('reload',
          {'action': 'store_true',
           'help': 'Restart the server if any source file is changed'}),
@@ -254,7 +258,7 @@
                 filelist_path=os.environ.get(
                     self._reloader_filelist_environ_key))
 
-        if not self['reload'] and not self['debug']:
+        if not (self['no-daemon'] or self['reload'] or self['debug']):
             self.daemonize(cwconfig['pid-file'])
             self.record_pid(cwconfig['pid-file'])