Add --proctitle to paster run.

When the setproctitle module is available and --proctitle is passed,
paster run will set the process title (as seen by ps, top, etc.) to the
specified value.
This commit is contained in:
Neil Williams
2011-06-10 19:48:25 -07:00
parent ddc3bafee0
commit 40eedd012d

View File

@@ -49,8 +49,18 @@ class RunCommand(command.Command):
parser.add_option('-c', '--command',
dest='command',
help="execute command in module")
parser.add_option("", "--proctitle",
dest="proctitle",
help="set the title seen by ps and top")
def command(self):
try:
if self.options.proctitle:
import setproctitle
setproctitle.setproctitle("paster " + self.options.proctitle)
except ImportError:
pass
here_dir = os.getcwd()
if self.args[0].lower() == 'standalone':