Sha256: 09f90d958c775f8c08023947aca5cb3151ba38460345703e76c4087359189ef1
Contents?: true
Size: 508 Bytes
Versions: 3
Compression:
Stored size: 508 Bytes
Contents
#! /usr/bin/env ruby # An example of subcommands require "clamp" class AdminCommand < Clamp::Command option "--timeout", "SECONDS", "connection timeout", :default => 5, :environment_variable => "MYAPP_TIMEOUT" do |x| Integer(x) end parameter "HOST", "server address" parameter "[PORT]", "server port", :default => 80, :environment_variable => "MYAPP_PORT" def execute puts "trying to connect to #{host} on port #{port} (waiting up to #{timeout} seconds)" end end AdminCommand.run
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
clamp-0.5.1 | examples/admin |
clamp-0.5.0 | examples/admin |
clamp-0.4.0 | examples/admin |