Sha256: 0578ffc41ddcb7b816e5b7528a1e3afa410658e71e6003df23243d6de940fa24

Contents?: true

Size: 704 Bytes

Versions: 1

Compression:

Stored size: 704 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

    package_name <%= config[:gem_class] %>::Identity.label

    # 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

1 entries across 1 versions & 1 rubygems

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