Sha256: 8a8ef58150c526e73612c72e9a42801005826f63cd529479881c8feb0bbfccd8

Contents?: true

Size: 464 Bytes

Versions: 11

Compression:

Stored size: 464 Bytes

Contents

require 'rbkb/cli'

# Copyright 2009 emonti at matasano.com 
# See README.rdoc for license information
#
# Repeats an argument N times
class Rbkb::Cli::Chars < Rbkb::Cli::Executable
  def make_parser
    super()
    @oparse.banner += " 100 A; # print 100 A's"
  end

  def parse(*args)
    super(*args)
    bail_args @argv.join(' ') unless @argv.size == 2
  end

  def go(*args)
    super(*args)
    @stdout << @argv[1] * @argv[0].to_i
    self.exit(0)
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
emonti-rbkb-0.6.6 lib/rbkb/cli/chars.rb
emonti-rbkb-0.6.7 lib/rbkb/cli/chars.rb
emonti-rbkb-0.6.8 lib/rbkb/cli/chars.rb
emonti-rbkb-0.6.9.1 lib/rbkb/cli/chars.rb
emonti-rbkb-0.6.9 lib/rbkb/cli/chars.rb
rbkb-0.7.2 lib/rbkb/cli/chars.rb
rbkb-0.7.1 lib/rbkb/cli/chars.rb
rbkb-0.7.0 lib/rbkb/cli/chars.rb
rbkb-0.6.12 lib/rbkb/cli/chars.rb
rbkb-0.6.11 lib/rbkb/cli/chars.rb
rbkb-0.6.10 lib/rbkb/cli/chars.rb