Changeset 7997
- Timestamp:
- 03/17/08 01:25:58 (5 years ago)
- Files:
-
- 1 modified
-
lang/python/misc/watchman (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/python/misc/watchman
r7996 r7997 1 1 #!/usr/bin/env python 2 2 3 usage = """ 4 %prog is watching file changes and execute command then. 5 usage: %prog [options] command [arg ...] 6 """ 3 usage = """%prog [options] -- command [params] 4 %prog is watching file changes and execute command then.""" 7 5 8 6 import os … … 38 36 return set(l) 39 37 40 def main( cmd,args, options):38 def main(args, options): 41 39 pid = -1 42 40 old = set() … … 46 44 if options.single and pid >= 0: 47 45 os.kill(pid, SIGTERM) 48 pid = os.spawnvp(os.P_NOWAIT, cmd, args)46 pid = os.spawnvp(os.P_NOWAIT, args[0], args) 49 47 old = new 50 48 sleep(options.sleep_time) … … 53 51 (options, args) = parse_and_validate() 54 52 try: 55 main(args [0], args[1:], options)53 main(args, options) 56 54 except KeyboardInterrupt: 57 55 pass
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)