README.md in git-gsub-0.0.5 vs README.md in git-gsub-0.0.6
- old
+ new
@@ -2,17 +2,29 @@
A Git subcommand to do gsub in a repository
## Usage
-To substitute `Git` with `Subversion`, run
+```
+Usage: git gsub [options] FROM TO [PATHS]
+ -v, --version Print version
+ --snake Experimental: substitute snake-cased expressions
+ --camel Experimental: substitute camel-cased expressions
+ --kebab Experimental: substitute kebab-cased expressions
+ --rename Rename files along with substitution
+ --dry-run Print commands to be run
+```
+## Example
+
+To substitute `Git` with `Subversion`:
+
```
$ git gsub Git Subversion
```
-Then you will get
+Result:
```diff
diff --git a/README.md b/README.md
index 2185dbf..393dbc6 100644
--- a/README.md
@@ -33,28 +45,77 @@
require 'git/gsub'
-Git::Gsub.run
+Subversion::Gsub.run
```
-## Installation
+## Experimental features
+To substitute `CommonLisp` with `VisualBasic` with case-awareness:
```
-$ gem install git-gsub
+$ git gsub CommonLisp VisualBasic --kebab --snake --camel
```
-## Escaping special characters
+Result:
-`git-gsub` uses `sed` internally, so escaping is same as it.
+```diff
+diff --git a/README.md b/README.md
+index 2185dbf..393dbc6 100644
+--- a/README.md
++++ b/README.md
+@@ -1,4 +1,4 @@
+-# CommonLisp common_lisp common-lisp
++# VisualBasic visual_basic visual-basic
+```
-If you want to replace `git/gsub` with `svn/gsub`, the command will be
+Substitute and rename file:
```
-$ git gsub "git\/gsub" "svn\/gsub"
+$ git gsub ruby haskell --rename --camel
```
+Result:
+
+```diff
+diff --git a/haskell.hs b/haskell.hs
+new file mode 100644
+index 0000000..ae86ce3
+--- /dev/null
++++ b/haskell.hs
+@@ -0,0 +1 @@
++putStrLn "Haskell"
+diff --git a/haskell.rb b/haskell.rb
+new file mode 100644
+index 0000000..9f363d3
+--- /dev/null
++++ b/haskell.rb
+@@ -0,0 +1 @@
++puts "haskell"
+diff --git a/ruby.hs b/ruby.hs
+deleted file mode 100644
+index 70db14d..0000000
+--- a/ruby.hs
++++ /dev/null
+@@ -1 +0,0 @@
+-putStrLn "Ruby"
+diff --git a/ruby.rb b/ruby.rb
+deleted file mode 100644
+index 966eb68..0000000
+--- a/ruby.rb
++++ /dev/null
+@@ -1 +0,0 @@
+```
+
+Caution: Case conversion is done with [ActiveSupport/Inflector](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html) , which substitutes `::` with `/`. This may cause unexpected result in the language other than Ruby.
+
+## Installation
+
+```
+$ gem install git-gsub
+```
+
## Supported platforms
-Maybe on many *nix like OS which has sed/gsed.
+Maybe on many *nix like OS which has Perl and sed.
## Contributing
1. Fork it ( http://github.com/fujimura/git-gsub/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)