Skip to content

holgerk/search-and-replace

Repository files navigation

Build Status Coverage

Search And Replace

Features

  • search and replace a string in the current directory
  • regular expressions
  • rename files and directories
  • interactive mode - confirm every replacement and rename
  • files ignored by a .gitignore in the working directory are ignorered

Installation

go get github.com/holgerk/search-and-replace
cd $GOPATH/src/github.com/holgerk/search-and-replace
go get
go install

Usage

Usage:
  search-and-replace [OPTIONS] Search Replace

Application Options:
  -d, --dry-run      Do not change anything
  -r, --regexp       Treat search string as regular expression
  -v, --verbose      Show verbose debug information
  -i, --interactive  Confirm every replacement

Help Options:
  -h, --help         Show this help message

Arguments:
  Search
  Replace

Examples

Regexp

match baarfooo and replace with fooobaar

search-and-replace -r "(ba+r)(fo+)" "${2}${1}"

Demo (Interactive Mode)

demo-interactive-mode

TODO

  • -ignore files from .gitignore-

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published