Sha256: ba188b3c7d8d839588b13576e6ffacb997a207f2be662dc88343c6876650ea53

Contents?: true

Size: 650 Bytes

Versions: 9

Compression:

Stored size: 650 Bytes

Contents

require "thor"

module <%= project_class_name %>
  class Main < Command
    class_option :verbose, type: :boolean
    class_option :noop, type: :boolean

    desc "hello NAME", "say hello to NAME"
    long_desc Help.text(:hello)
    option :from, desc: "from person"
    def hello(name="you")
      puts "from: #{options[:from]}" if options[:from]
      puts "Hello #{name}"
    end

    desc "completions *PARAMS", "prints words for auto-completion"
    long_desc Help.text(:completions)
    def completions(*params)
      Completer.new(*params).run
    end

    desc "version", "prints version"
    def version
      puts VERSION
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cli-template-4.0.2 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-4.0.1 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-4.0.0 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-3.5.1 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-3.5.0 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-3.4.0 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-3.3.0 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-3.2.0 lib/templates/colon_namespaces/lib/%underscored_name%/main.rb.tt
cli-template-3.1.0 lib/templates/default/lib/%underscored_name%/main.rb.tt