nimgrep.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. =========================
  2. nimgrep User's manual
  3. =========================
  4. :Author: Andreas Rumpf
  5. :Version: 0.9
  6. Nimgrep is a command line tool for search&replace tasks. It can search for
  7. regex or peg patterns and can search whole directories at once. User
  8. confirmation for every single replace operation can be requested.
  9. Nimgrep has particularly good support for Nim's
  10. eccentric *style insensitivity*. Apart from that it is a generic text
  11. manipulation tool.
  12. Installation
  13. ============
  14. Compile nimgrep with the command::
  15. nim c -d:release tools/nimgrep.nim
  16. And copy the executable somewhere in your ``$PATH``.
  17. Command line switches
  18. =====================
  19. Usage:
  20. nimgrep [options] [pattern] [replacement] (file/directory)*
  21. Options:
  22. --find, -f find the pattern (default)
  23. --replace, -r replace the pattern
  24. --peg pattern is a peg
  25. --re pattern is a regular expression (default); extended
  26. syntax for the regular expression is always turned on
  27. --recursive process directories recursively
  28. --confirm confirm each occurrence/replacement; there is a chance
  29. to abort any time without touching the file
  30. --stdin read pattern from stdin (to avoid the shell's confusing
  31. quoting rules)
  32. --word, -w the match should have word boundaries (buggy for pegs!)
  33. --ignoreCase, -i be case insensitive
  34. --ignoreStyle, -y be style insensitive
  35. --ext:EX1|EX2|... only search the files with the given extension(s)
  36. --verbose be verbose: list every processed file
  37. --help, -h shows this help
  38. --version, -v shows the version