Skip to content

Commit fd67ed4

Browse files
dslhctran
authored andcommitted
Update CLI options in README. (#519)
1 parent 7a96e90 commit fd67ed4

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

README.rdoc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ you can do so with a simple environment variable, instead of editing the
161161

162162
Usage: annotate [options] [model_file]*
163163
-d, --delete Remove annotations from all model files or the routes.rb file
164-
-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)
164+
-p [before|top|after|bottom], Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/route/serializer file(s)
165+
--position
165166
--pc, --position-in-class [before|top|after|bottom]
166167
Place the annotations at the top (before) or the bottom (after) of the model file
167168
--pf, --position-in-factory [before|top|after|bottom]
@@ -179,17 +180,19 @@ you can do so with a simple environment variable, instead of editing the
179180
--wo, --wrapper-open STR Annotation wrapper opening.
180181
--wc, --wrapper-close STR Annotation wrapper closing
181182
-r, --routes Annotate routes.rb with the output of 'rake routes'
182-
-aa, --active-admin Annotate all activeadmin models
183+
-a, --active-admin Annotate active_admin models
183184
-v, --version Show the current version of this gem
184185
-m, --show-migration Include the migration version number in the annotation
185-
-i, --show-indexes List the table's database indexes in the annotation
186186
-k, --show-foreign-keys List the table's foreign key constraints in the annotation
187187
--ck, --complete-foreign-keys
188188
Complete foreign key names in the annotation
189+
-i, --show-indexes List the table's database indexes in the annotation
189190
-s, --simple-indexes Concat the column's related indexes in the annotation
190191
--model-dir dir Annotate model files stored in dir rather than app/models, separate multiple dirs with commas
192+
--root-dir dir Annotate files stored within root dir projects, separate multiple dirs with commas
191193
--ignore-model-subdirects Ignore subdirectories of the models directory
192194
--sort Sort columns alphabetically, rather than in creation order
195+
--classified-sort Sort columns alphabetically, but first goes id, then the rest columns, then the timestamp columns and then the association columns
193196
-R, --require path Additional file to require before loading models, may be used multiple times
194197
-e [tests,fixtures,factories,serializers],
195198
--exclude Do not annotate fixtures, test files, factories, and/or serializers
@@ -199,6 +202,13 @@ you can do so with a simple environment variable, instead of editing the
199202
--timestamp Include timestamp in (routes) annotation
200203
--trace If unable to annotate a file, print the full stack trace, not just the exception message.
201204
-I, --ignore-columns REGEX don't annotate columns that match a given REGEX (i.e., `annotate -I '^(id|updated_at|created_at)'`
205+
--ignore-routes REGEX don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'`
206+
--hide-limit-column-types VALUES
207+
don't show limit for given column types, separated by commas (i.e., `integer,boolean,text`)
208+
--hide-default-column-types VALUES
209+
don't show default for given column types, separated by commas (i.e., `json,jsonb,hstore`)
210+
--ignore-unknown-models don't display warnings for bad model files
211+
--with-comment include database comments in model annotations
202212

203213

204214

bin/annotate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ OptionParser.new do |opts|
9090
ENV['routes'] = 'true'
9191
end
9292

93-
opts.on('-aa', '--active-admin', 'Annotate active_admin models') do
93+
opts.on('-a', '--active-admin', 'Annotate active_admin models') do
9494
ENV['active_admin'] = 'true'
9595
end
9696

@@ -198,7 +198,7 @@ OptionParser.new do |opts|
198198
ENV['ignore_unknown_models'] = 'true'
199199
end
200200

201-
opts.on('--with-comment', "include database comments") do |values|
201+
opts.on('--with-comment', "include database comments in model annotations") do |values|
202202
ENV['with_comment'] = 'true'
203203
end
204204
end.parse!

0 commit comments

Comments
 (0)