Sha256: 349a0656fc3e4ec770ac829a8f6b482047b28b23aa252bb59ee6ca91b06e034b

Contents?: true

Size: 276 Bytes

Versions: 4

Compression:

Stored size: 276 Bytes

Contents

#! /usr/bin/env ruby

# Demonstrate subcommand_missing

require "clamp"

Clamp do

  subcommand "hello", "Say hello" do
    def execute
      puts "Hello"
    end
  end

  def subcommand_missing(name)
    abort "Install bye plugin first" if name == "bye"
    super
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

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