Sha256: 3f893ee16734a8d56d6887dd4bdb0753ffb8d7da75d29e9bd2da586a13ab7177

Contents?: true

Size: 578 Bytes

Versions: 1

Compression:

Stored size: 578 Bytes

Contents

#!/usr/bin/env ruby

require 'sperm'
require 'optparse'

optparse = OptionParser.new do |opts|
  opts.banner = "Usage: #{$PROGRAM_NAME} [options] order"

  opts.on_tail '-p', '--permutation ORDER', Integer,
               'Generate permutation of specified order' do |order|
    Sperm.rand(order).each { |element| puts element }
    exit
  end

  opts.on_tail '-h', '--help', 'Just display this help' do
    puts opts
    exit
  end

  opts.on_tail '-v', '--version', 'Just print the version infomation' do
    puts "Sperm #{Sperm::VERSION}"
    exit
  end
end

optparse.parse!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sperm-0.1.1 bin/sperm