Sha256: 85068e15a0ebdba388cabf91aa45374c466cc00e9df4f1444a7630d02d12a9b2

Contents?: true

Size: 705 Bytes

Versions: 4

Compression:

Stored size: 705 Bytes

Contents

module <%= MiscUtils.camel_case(name) %>
  class CLI < Thor
    desc 'execute', 'Execute the main program'
    method_option 'version',
                  aliases: '-v',
                  desc: 'Display version number'
    def execute
      opts = options.symbolize_keys
      if opts[:version]
        puts "You are using <%= MiscUtils.camel_case(name) %> version #{<%= MiscUtils.camel_case(name) %>::VERSION}"
        exit
      end
      process(opts)
    end

    desc 'usage', 'Display help screen'
    def usage
      puts <<-EOS
TODO: Add your sample usage here
      EOS
    end

    default_task :usage

    private

    def process(opts = {})
      puts "Your options: #{opts}"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gem_bootstrap-0.2.9 templates/lib/newgem/cli.rb
gem_bootstrap-0.2.8 templates/lib/newgem/cli.rb
gem_bootstrap-0.2.7 templates/lib/newgem/cli.rb
gem_bootstrap-0.2.6 templates/lib/newgem/cli.rb