module Trustworthy::CLI::Command
Public Instance Methods
default_options()
click to toggle source
# File lib/trustworthy/cli/command.rb, line 4 def default_options {config_file: 'trustworthy.yml'} end
parse_options(command, args) { |opts, options| ... }
click to toggle source
# File lib/trustworthy/cli/command.rb, line 8 def parse_options(command, args) options = default_options @parser = OptionParser.new do |opts| opts.banner = "#{Trustworthy::CLI.banner}\n\nUsage: trustworthy #{command} [options]\n" opts.on('-c', '--config FILE', 'Configuration file to use (default: trustworthy.yml)') do |file| options[:config_file] = file end opts.on_tail('-h', '--help', 'Show this message') do puts opts exit end if block_given? yield opts, options end end @parser.parse!(args) options end
print_help()
click to toggle source
# File lib/trustworthy/cli/command.rb, line 29 def print_help puts @parser if @parser end
say(message)
click to toggle source
# File lib/trustworthy/cli/command.rb, line 33 def say(message) $terminal.say(message) end