Skip to content

Commit 769cf57

Browse files
committed
Change --additional_file_patterns to use dash instead of underscore
Other flags use dash instead of underscore. Changing it for consistency.
1 parent 05ee216 commit 769cf57

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/annotate/parser.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,14 @@ def add_options_to_parser(option_parser) # rubocop:disable Metrics/MethodLength
4949

5050
option_parser.banner = 'Usage: annotate [options] [model_file]*'
5151

52-
option_parser.on('--additional_file_patterns path1,path2,path3', Array, "Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`)") do |additional_file_patterns|
52+
option_parser.on('--additional-file-patterns path1,path2,path3', Array, "Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`)") do |additional_file_patterns|
5353
ENV['additional_file_patterns'] = additional_file_patterns
5454
end
5555

5656
option_parser.on('-d', '--delete', 'Remove annotations from all model files or the routes.rb file') do
5757
@options[:target_action] = :remove_annotations
5858
end
5959

60-
option_parser.on('--additional_file_patterns path1,path2,path3', Array, "Additional file paths or globs to annotate") do |additional_file_patterns|
61-
ENV['additional_file_patterns'] = additional_file_patterns
62-
end
63-
6460
option_parser.on('-p', '--position [before|top|after|bottom]', positions,
6561
'Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/route/serializer file(s)') do |p|
6662
env['position'] = p

spec/lib/annotate/parser_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Annotate # rubocop:disable Metrics/ModuleLength
1414
end
1515
end
1616

17-
%w[--additional_file_patterns].each do |option|
17+
%w[--additional-file-patterns].each do |option|
1818
describe option do
1919
it 'sets array of paths to :additional_file_patterns' do
2020
# options = "-a ${('foo/bar' 'baz')}"

0 commit comments

Comments
 (0)