class Sanctum::CLI

Public Class Methods

common_options(c, *opts) click to toggle source
# File lib/sanctum/cli.rb, line 10
def self.common_options(c, *opts)
  opts.map(&:to_sym).each do |opt|
    case opt
    when :config
      c.desc 'specify config file'
      c.flag :c, :config
    when :targets
      c.desc 'Comma seperated list of targets'
      c.flag :t, :targets
    when :force
      c.desc 'Force, will not ask you to confirm differences'
      c.switch :force
    else
      raise "unrecognized option #{opt.inspect}"
    end
  end
end