lib/cc/cli/runner.rb in codeclimate-0.45.0 vs lib/cc/cli/runner.rb in codeclimate-0.46.0
- old
+ new
@@ -29,28 +29,33 @@
$stderr.puts "unknown command #{command}"
exit 1
end
def command_class
- CLI.const_get(command_name)
+ command_const = Command[command]
+ if command_const.abstract?
+ nil
+ else
+ command_const
+ end
rescue NameError
nil
end
- def command_name
- case command
- when nil, "-h", "-?", "--help" then "Help"
- when "-v", "--version" then "Version"
- else command.sub(":", "::").underscore.camelize
- end
- end
-
def command_arguments
@args[1..-1]
end
def command
- @args.first
+ command_name = @args.first
+ case command_name
+ when nil, "-h", "-?", "--help"
+ "help"
+ when "-v", "--version"
+ "version"
+ else
+ command_name
+ end
end
end
end
end