Commits

Stefan Saasen committed 84d46d1

Add instruction about how to stop watching for changes

  • Participants
  • Parent commits 51c0466

Comments (0)

Files changed (3)

 Spy
 ===
 
-Spy is a compact file system watcher for Mac OS X and Linux (Note: Should work on Windows but is currently untested).
+Spy is a compact file system watcher for Mac OS X and Linux (Note: Should work
+on Windows but is currently untested).
 
 
 Usage
 =====
 
-Spy expects a single argument, the directory or a single file to watch. Spy currently supports two different modes: watch and run mode.
+Spy expects a single argument, the directory or a single file to watch. Spy
+currently supports two different modes: watch and run mode.
+Press `CTRL-D` to stop watching for file system changes.
 
 Watch mode
 -----------
 
-In output mode Spy will print the path to a modified file to STDOUT (followed by a newline) whenever a file modification (new file added, file modified, file deleted) occurs.
+In output mode Spy will print the path to a modified file to STDOUT (followed
+by a newline) whenever a file modification (new file added, file modified, file
+deleted) occurs.
 
     $> spy watch .
     path/to/modified/file
 
     $> spy .
 
-It's possible to watch a single file (this obviously only shows changes to that particular file):
+It's possible to watch a single file (this obviously only shows changes to that
+particular file):
 
     $> spy /path/to/file
 
-The default format is the full path to the modified file followed by a newline. To make it easier to parse the output, the `--format=json` changes the output to be printed formatted as a JSON object (again followed by a newline).
+The default format is the full path to the modified file followed by a newline.
+To make it easier to parse the output, the `--format=json` changes the output
+to be printed formatted as a JSON object (again followed by a newline).
 
     $> spy watch --format=json .
     {"path":"/path/to/modified.file","flag":"Added","time":"2012-12-20 11:26:56.859456 UTC"}
 
 For directories the following options apply:
 
-An optional second argument can be used to filter the files in the given directory using a glob pattern:
+An optional second argument can be used to filter the files in the given
+directory using a glob pattern:
 
     $> spy watch /path/to/directory "*.md"
 
 Run mode
 --------
 
-In run mode Spy will execute a given command whenever a file modification occurs without printing modifications to stdout. The command will be executed with the path to the modified file as the last argument.
+In run mode Spy will execute a given command whenever a file modification
+occurs without printing modifications to stdout. The command will be executed
+with the path to the modified file as the last argument.
 
     $> spy run "./run-build.sh"
 
-In the example above the shell script `run-build.sh` would be executed with the path to the modified file as the first argument.
+In the example above the shell script `run-build.sh` would be executed with the
+path to the modified file as the first argument.
 
-If the command to be executed does not expect any (additional) arguments the `--notify-only` flag can be used. This will cause spy to execute the command without passing the path as an argument:
+If the command to be executed does not expect any (additional) arguments the
+`--notify-only` flag can be used. This will cause spy to execute the command
+without passing the path as an argument:
 
     $> spy run --notify-only "rake test" .
     

File distribution/man/spy.1.md

 \--notify-only=*true|false*
 :   If set to `false` (the default) spy will pass the path to the modified file to the command that will be executed. To execute the given command without passing the path, set this option to `true`.
 
+Use `CTRL-D` to stop watching for file system events.
 
 # SEE ALSO
 
 main = do
     config <- cmdArgsRun mode
     canonicalizedDir <- canonicalizePath $ dir config
+    putStrLn "Press Ctrl-D to stop"
     spy (config { dir = addTrailingPathSeparator canonicalizedDir }) $
         putStrLn "No eyes on the target"