Changeset 7997

Show
Ignore:
Timestamp:
03/17/08 01:25:58 (5 years ago)
Author:
jbking
Message:

lang/python/misc/watchman コマンドの引数が指定できていなかった

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/python/misc/watchman

    r7996 r7997  
    11#!/usr/bin/env python 
    22 
    3 usage = """ 
    4 %prog is watching file changes and execute command then. 
    5 usage: %prog [options] command [arg ...] 
    6 """ 
     3usage = """%prog [options] -- command [params] 
     4%prog is watching file changes and execute command then.""" 
    75 
    86import os 
     
    3836    return set(l) 
    3937 
    40 def main(cmd, args, options): 
     38def main(args, options): 
    4139    pid = -1 
    4240    old = set() 
     
    4644            if options.single and pid >= 0: 
    4745                os.kill(pid, SIGTERM) 
    48             pid = os.spawnvp(os.P_NOWAIT, cmd, args) 
     46            pid = os.spawnvp(os.P_NOWAIT, args[0], args) 
    4947            old = new 
    5048        sleep(options.sleep_time) 
     
    5351    (options, args) = parse_and_validate() 
    5452    try: 
    55         main(args[0], args[1:], options) 
     53        main(args, options) 
    5654    except KeyboardInterrupt: 
    5755        pass