Sha256: 091ad24801d0e68190f0d106ff8359c4b950113808310def5a03e212a57a060d

Contents?: true

Size: 471 Bytes

Versions: 7

Compression:

Stored size: 471 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

  self.default_subcommand = "flip"

  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

7 entries across 7 versions & 2 rubygems

Version Path
clamp-0.5.1 examples/flipflop
clamp-0.5.0 examples/flipflop
clamp-0.4.0 examples/flipflop
jls-clamp-0.3.1.2 examples/flipflop
jls-clamp-0.3.1 examples/flipflop
clamp-0.3.1 examples/flipflop
clamp-0.3.0 examples/flipflop