File: subcommand_missing

package info (click to toggle)
ruby-clamp 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 312 kB
  • sloc: ruby: 2,359; makefile: 4
file content (18 lines) | stat: -rwxr-xr-x 242 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /usr/bin/env ruby

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