Commit 31995449 by Kamil Bielawski

Update Readme and accepted options in OptionParser

parent 9246f217
...@@ -154,18 +154,18 @@ you can do so with a simple environment variable, instead of editing the ...@@ -154,18 +154,18 @@ you can do so with a simple environment variable, instead of editing the
Usage: annotate [options] [model_file]* Usage: annotate [options] [model_file]*
-d, --delete Remove annotations from all model files or the routes.rb file -d, --delete Remove annotations from all model files or the routes.rb file
-p, --position [before|after] Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/routes file(s) -p, --position [before|top|after|bottom] Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/routes file(s)
--pc, --position-in-class [before|after] --pc, --position-in-class [before|top|after|bottom]
Place the annotations at the top (before) or the bottom (after) of the model file Place the annotations at the top (before) or the bottom (after) of the model file
--pf, --position-in-factory [before|after] --pf, --position-in-factory [before|top|after|bottom]
Place the annotations at the top (before) or the bottom (after) of any factory files Place the annotations at the top (before) or the bottom (after) of any factory files
--px, --position-in-fixture [before|after] --px, --position-in-fixture [before|top|after|bottom]
Place the annotations at the top (before) or the bottom (after) of any fixture files Place the annotations at the top (before) or the bottom (after) of any fixture files
--pt, --position-in-test [before|after] --pt, --position-in-test [before|top|after|bottom]
Place the annotations at the top (before) or the bottom (after) of any test files Place the annotations at the top (before) or the bottom (after) of any test files
--pr, --position-in-routes [before|after] --pr, --position-in-routes [before|top|after|bottom]
Place the annotations at the top (before) or the bottom (after) of the routes.rb file Place the annotations at the top (before) or the bottom (after) of the routes.rb file
--ps, --position-in-serializer [before|after] --ps, --position-in-serializer [before|top|after|bottom]
Place the annotations at the top (before) or the bottom (after) of the serializer files Place the annotations at the top (before) or the bottom (after) of the serializer files
-r, --routes Annotate routes.rb with the output of 'rake routes' -r, --routes Annotate routes.rb with the output of 'rake routes'
-v, --version Show the current version of this gem -v, --version Show the current version of this gem
......
...@@ -32,7 +32,7 @@ OptionParser.new do |opts| ...@@ -32,7 +32,7 @@ OptionParser.new do |opts|
target[:task] = :remove_annotations target[:task] = :remove_annotations
end end
opts.on('-p', '--position [before|after]', ['before', 'after'], opts.on('-p', '--position [before|top|after|bottom]', ['before', 'top', 'after', 'bottom'],
"Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/routes file(s)") do |p| "Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/routes file(s)") do |p|
ENV['position'] = p ENV['position'] = p
[ [
...@@ -42,37 +42,37 @@ OptionParser.new do |opts| ...@@ -42,37 +42,37 @@ OptionParser.new do |opts|
end end
end end
opts.on('--pc', '--position-in-class [before|after]', ['before', 'after'], opts.on('--pc', '--position-in-class [before|top|after|bottom]', ['before', 'top', 'after', 'bottom'],
"Place the annotations at the top (before) or the bottom (after) of the model file") do |p| "Place the annotations at the top (before) or the bottom (after) of the model file") do |p|
ENV['position_in_class'] = p ENV['position_in_class'] = p
has_set_position['position_in_class'] = true has_set_position['position_in_class'] = true
end end
opts.on('--pf', '--position-in-factory [before|after]', ['before', 'after'], opts.on('--pf', '--position-in-factory [before|top|after|bottom]', ['before', 'top', 'after', 'bottom'],
"Place the annotations at the top (before) or the bottom (after) of any factory files") do |p| "Place the annotations at the top (before) or the bottom (after) of any factory files") do |p|
ENV['position_in_factory'] = p ENV['position_in_factory'] = p
has_set_position['position_in_factory'] = true has_set_position['position_in_factory'] = true
end end
opts.on('--px', '--position-in-fixture [before|after]', ['before', 'after'], opts.on('--px', '--position-in-fixture [before|top|after|bottom]', ['before', 'top', 'after', 'bottom'],
"Place the annotations at the top (before) or the bottom (after) of any fixture files") do |p| "Place the annotations at the top (before) or the bottom (after) of any fixture files") do |p|
ENV['position_in_fixture'] = p ENV['position_in_fixture'] = p
has_set_position['position_in_fixture'] = true has_set_position['position_in_fixture'] = true
end end
opts.on('--pt', '--position-in-test [before|after]', ['before', 'after'], opts.on('--pt', '--position-in-test [before|top|after|bottom]', ['before', 'top', 'after', 'bottom'],
"Place the annotations at the top (before) or the bottom (after) of any test files") do |p| "Place the annotations at the top (before) or the bottom (after) of any test files") do |p|
ENV['position_in_test'] = p ENV['position_in_test'] = p
has_set_position['position_in_test'] = true has_set_position['position_in_test'] = true
end end
opts.on('--pr', '--position-in-routes [before|after]', ['before', 'after'], opts.on('--pr', '--position-in-routes [before|top|after|bottom]', ['before', 'top', 'after', 'bottom'],
"Place the annotations at the top (before) or the bottom (after) of the routes.rb file") do |p| "Place the annotations at the top (before) or the bottom (after) of the routes.rb file") do |p|
ENV['position_in_routes'] = p ENV['position_in_routes'] = p
has_set_position['position_in_routes'] = true has_set_position['position_in_routes'] = true
end end
opts.on('--ps', '--position-in-serializer [before|after]', ['before', 'after'], opts.on('--ps', '--position-in-serializer [before|top|after|bottom]', ['before', 'top', 'after', 'bottom'],
"Place the annotations at the top (before) or the bottom (after) of the serializer files") do |p| "Place the annotations at the top (before) or the bottom (after) of the serializer files") do |p|
ENV['position_in_serializer'] = p ENV['position_in_serializer'] = p
has_set_position['position_in_serializer'] = true has_set_position['position_in_serializer'] = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment