Skip to content

Commit

Permalink
Update Readme and accepted options in OptionParser
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilbielawski committed Jan 3, 2015
1 parent 9246f21 commit 3199544
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@ you can do so with a simple environment variable, instead of editing the

Usage: annotate [options] [model_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)
--pc, --position-in-class [before|after]
-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|top|after|bottom]
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
--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
--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
--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
--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
-r, --routes Annotate routes.rb with the output of 'rake routes'
-v, --version Show the current version of this gem
Expand Down
14 changes: 7 additions & 7 deletions bin/annotate
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ OptionParser.new do |opts|
target[:task] = :remove_annotations
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|
ENV['position'] = p
[
Expand All @@ -42,37 +42,37 @@ OptionParser.new do |opts|
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|
ENV['position_in_class'] = p
has_set_position['position_in_class'] = true
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|
ENV['position_in_factory'] = p
has_set_position['position_in_factory'] = true
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|
ENV['position_in_fixture'] = p
has_set_position['position_in_fixture'] = true
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|
ENV['position_in_test'] = p
has_set_position['position_in_test'] = true
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|
ENV['position_in_routes'] = p
has_set_position['position_in_routes'] = true
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|
ENV['position_in_serializer'] = p
has_set_position['position_in_serializer'] = true
Expand Down

0 comments on commit 3199544

Please sign in to comment.