class Brick::CLI_Validator
Constants
- NO_COMMAND_GIVEN
Public Class Methods
no_command_given?()
click to toggle source
# File lib/brick/cli__validator.rb, line 16 def self.no_command_given? ARGV.empty? end
no_subcommand_given?()
click to toggle source
# File lib/brick/cli__validator.rb, line 12 def self.no_subcommand_given? ARGV[0] =~ /^-/ end
print_help_and_exit(exitcode=1, fatal_message=nil)
click to toggle source
# File lib/brick/cli__validator.rb, line 20 def self.print_help_and_exit(exitcode=1, fatal_message=nil) Brick::CLI::logger.error(fatal_message) if fatal_message Brick::CLI.list_parameters Brick::CLI.list_commands exit exitcode end
validate()
click to toggle source
# File lib/brick/cli__validator.rb, line 5 def self.validate if no_command_given? print_help_and_exit(1, NO_COMMAND_GIVEN) end end