Sha256: 2086de0cde441e305eb76cc99b57892755656eba138f287e9537e9dd07211182

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 Bytes

Contents

require "yaml"
require "thor"
require "thor/actions"
require "thor_plus/actions"

module <%= config[:gem_class] %>
  class CLI < Thor
  	include Thor::Actions
  	include ThorPlus::Actions

    # Initialize.
    def initialize args = [], options = {}, config = {}
      super args, options, config
    end

    desc "-v, [--version]", "Show version."
    map %w(-v --version) => :version
    def version
      say <%= config[:gem_class] %>::Identity.label_version
    end

    desc "-h, [--help=HELP]", "Show this message or get help for a command."
    map %w(-h --help) => :help
    def help task = nil
      say and super
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gemsmith-5.2.0 lib/gemsmith/templates/%gem_name%/lib/%gem_name%/cli.rb.tt
gemsmith-5.1.0 lib/gemsmith/templates/%gem_name%/lib/%gem_name%/cli.rb.tt