Sha256: 2f962482fd4c8afdfe6c9d1e09c777cd8f3b370b9a328885ad71d6edb6c6f672
Contents?: true
Size: 497 Bytes
Versions: 3
Compression:
Stored size: 497 Bytes
Contents
#! /usr/bin/env ruby # frozen_string_literal: true # An example of subcommands (including a default subcommand) require "clamp" require "clamp/version" Clamp do option ["--version", "-v"], :flag, "Show version" do puts "Powered by Clamp-#{Clamp::VERSION}" exit(0) end self.default_subcommand = "flip" subcommand "flip", "flip it" do def execute puts "FLIPPED" end end subcommand "flop", "flop it" do def execute puts "FLOPPED" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
clamp-1.3.2 | examples/flipflop |
clamp-1.3.1 | examples/flipflop |
clamp-1.3.0 | examples/flipflop |