Sha256: 114e7f49a7bb2199abe97fb7fc08a7b35a990992ae3d334efc949c29e8bb4b04

Contents?: true

Size: 619 Bytes

Versions: 6

Compression:

Stored size: 619 Bytes

Contents

require 'commander'
require 'stringio'

def create_test_command
  command :test do |c|
    c.syntax = "test [options] <file>"
    c.description = "test description"
    c.example "description", "command"
    c.example "description 2", "command 2"
    c.option "-t", "--trace", "trace description"
    c.option "--verbose", "verbose description"
    c.when_called do |args, options|
      "test %s" % args.join
    end
  end
end

def new_command_runner *args
  $command_runner = Commander::Runner.new args
  program :name, "test"
  program :version, "1.2.3"
  program :description, "something"
  create_test_command
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
visionmedia-commander-2.4.2 spec/spec_helper.rb
visionmedia-commander-2.4.3 spec/spec_helper.rb
visionmedia-commander-2.4.4 spec/spec_helper.rb
visionmedia-commander-2.4.6 spec/spec_helper.rb
visionmedia-commander-2.5.6 spec/spec_helper.rb
visionmedia-commander-2.5.7 spec/spec_helper.rb