Sha256: b7734b73c375ff6507a71d200ba058cfe714e2186a1964f5b309586b06caa72d

Contents?: true

Size: 456 Bytes

Versions: 1

Compression:

Stored size: 456 Bytes

Contents

unless Object.respond_to? :tap
  class Object
    def tap
      yield(self)
      self
    end
  end
end

module GLI
  def command(*names, &block)
    command = Command.new([names].flatten,@@next_desc,@@next_arg_name,@@next_long_desc,@@skips_pre,@@skips_post)
    commands[command.name] = command
    command.instance_eval(&block)
    # yield command
    command.tap do |c|
      c.desc "Help"
      c.switch [:h, :help]
    end
    clear_nexts
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pagoda-0.5.0 lib/pagoda/cli/override.rb