Module: Tomo::CLI::CommonOptions
- Included in:
- Tomo::Commands::Default, Tomo::Commands::Deploy, Tomo::Commands::Init, Tomo::Commands::Run, Tomo::Commands::Setup, Tomo::Commands::Tasks, Tomo::Commands::Version
- Defined in:
- lib/tomo/cli/common_options.rb
Class Method Summary collapse
-
.included(mod) ⇒ Object
rubocop:disable Metrics/MethodLength.
Class Method Details
.included(mod) ⇒ Object
rubocop:disable Metrics/MethodLength
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tomo/cli/common_options.rb', line 6 def self.included(mod) # rubocop:disable Metrics/MethodLength mod.class_eval do option :color, "--[no-]color", "Enable/disable color output" do |color| Colors.enabled = color end option :debug, "--[no-]debug", "Enable/disable verbose debug logging" do |debug| Tomo.debug = debug end option :quiet, "--[no-]quiet", "Silence all progress output" do |quiet| Tomo.quiet = quiet end option :trace, "--[no-]trace", "Display full backtrace on error" do |trace| CLI.show_backtrace = trace end option :help, "-h, --help", "Print this documentation" do |_help| puts instance_variable_get(:@parser) CLI.exit end after_parse :dump_runtime_info end end |