Sha256: 9b898ced3aaedec95dda11c7452586e27cea294b6d93c208ec1ce580ef53dcb2

Contents?: true

Size: 306 Bytes

Versions: 3

Compression:

Stored size: 306 Bytes

Contents

#! /usr/bin/env ruby
# frozen_string_literal: true

# 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

3 entries across 3 versions & 1 rubygems

Version Path
clamp-1.3.2 examples/subcommand_missing
clamp-1.3.1 examples/subcommand_missing
clamp-1.3.0 examples/subcommand_missing