Sha256: 278e1ecc8df79dbccad210808d8e15fa445f3ab44c09ed96eb22471668ff5b07

Contents?: true

Size: 445 Bytes

Versions: 4

Compression:

Stored size: 445 Bytes

Contents

#! /usr/bin/env ruby

# An example of subcommands

require "clamp"
require "clamp/version"

class FlipFlop < Clamp::Command

  option ["--version", "-v"], :flag, "Show version" do
    puts "Powered by Clamp-#{Clamp::VERSION}"
    exit(0)
  end

  default_subcommand "flip", "flip it" do
    def execute
      puts "FLIPPED"
    end
  end

  subcommand "flop", "flop it" do
    def execute
      puts "FLOPPED"
    end
  end
  
end

FlipFlop.run

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
clamp-0.2.3 examples/flipflop
clamp-0.2.2 examples/flipflop
clamp-0.2.1 examples/flipflop
clamp-0.2.0 examples/flipflop