comparison tests/dumbhttp.py @ 28451:c90cfe76e024

serve: accept multiple values for --daemon-postexec The next patch will add another postexec command: chdir, which can be used together with unlink. This patch changes the option type of --daemon-postexec from string to list to accept multiple commands. The error message of invalid --daemon-postexec value is also changed to include the actual invalid value.
author Jun Wu <quark@fb.com>
date Wed, 09 Mar 2016 02:07:40 +0000
parents 7623ba92af72
children 9366b18ba103
comparison
equal deleted inserted replaced
28450:155e3308289c 28451:c90cfe76e024
36 parser.add_option('--pid', dest='pid', 36 parser.add_option('--pid', dest='pid',
37 help='file name where the PID of the server is stored') 37 help='file name where the PID of the server is stored')
38 parser.add_option('-f', '--foreground', dest='foreground', 38 parser.add_option('-f', '--foreground', dest='foreground',
39 action='store_true', 39 action='store_true',
40 help='do not start the HTTP server in the background') 40 help='do not start the HTTP server in the background')
41 parser.add_option('--daemon-postexec') 41 parser.add_option('--daemon-postexec', action='append')
42 42
43 (options, args) = parser.parse_args() 43 (options, args) = parser.parse_args()
44 44
45 signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0)) 45 signal.signal(signal.SIGTERM, lambda x, y: sys.exit(0))
46 46