Sha256: ffcde86615082a58a0211343abb8db84dad1801511d06493835f512e497e0f38

Contents?: true

Size: 363 Bytes

Versions: 4

Compression:

Stored size: 363 Bytes

Contents

#! /usr/bin/env ruby

# Demonstrate "restful" style; parameters precede subcommands

require "clamp"

Clamp do

  banner %(
    Word ops.
  )

  parameter "WORD", "the word in question"

  subcommand "say", "Say it" do
    def execute
      puts word
    end
  end

  subcommand "shout", "Say it loud" do
    def execute
      puts word.upcase
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
clamp-1.2.1 examples/word
clamp-1.2.0 examples/word
clamp-1.2.0.beta1 examples/word
clamp-1.1.2 examples/word