File: subcommand_missing

package info (click to toggle)
ruby-clamp 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 364 kB
  • sloc: ruby: 2,851; makefile: 4
file content (21 lines) | stat: -rwxr-xr-x 306 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /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