@@ -218,7 +218,7 @@ def run(item)
218218 #{ Color . bold ( "stree help" ) }
219219 Display this help message
220220
221- #{ Color . bold ( "stree lsp" ) }
221+ #{ Color . bold ( "stree lsp [OPTIONS] " ) }
222222 Run syntax tree in language server mode
223223
224224 #{ Color . bold ( "stree version" ) }
@@ -239,6 +239,20 @@ class << self
239239 def run ( argv )
240240 name , *arguments = argv
241241
242+ # If there are any plugins specified on the command line, then load them
243+ # by requiring them here. We do this by transforming something like
244+ #
245+ # stree format --plugins=haml template.haml
246+ #
247+ # into
248+ #
249+ # require "syntax_tree/haml"
250+ #
251+ if arguments . first &.start_with? ( "--plugins=" )
252+ plugins = arguments . shift [ /^--plugins=(.*)$/ , 1 ]
253+ plugins . split ( "," ) . each { |plugin | require "syntax_tree/#{ plugin } " }
254+ end
255+
242256 case name
243257 when "help"
244258 puts HELP
@@ -282,20 +296,6 @@ def run(argv)
282296 return 1
283297 end
284298
285- # If there are any plugins specified on the command line, then load them
286- # by requiring them here. We do this by transforming something like
287- #
288- # stree format --plugins=haml template.haml
289- #
290- # into
291- #
292- # require "syntax_tree/haml"
293- #
294- if arguments . first &.start_with? ( "--plugins=" )
295- plugins = arguments . shift [ /^--plugins=(.*)$/ , 1 ]
296- plugins . split ( "," ) . each { |plugin | require "syntax_tree/#{ plugin } " }
297- end
298-
299299 # We're going to build up a queue of items to process.
300300 queue = Queue . new
301301
0 commit comments