Sha256: 76647896b618dd636fbaaa16543ebcea2094b96afc92c51f78a4545ed2ac708d

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

#
# Delegate execution to a sub command
#
# SYNOPSIS
#   #{program_name} [--version] [--help] [--output=...] COMMAND [cmd opts] ARGS...
#
# OPTIONS
# #{summarized_options}
#
# COMMANDS
# #{summarized_subcommands}
#
# DESCRIPTION
#   This example shows how to write a delegate command, that is, a
#   command which delegates to a subcommand
#
# See '#{program_name} help COMMAND' for more information on a specific command.
#
class Delegate < Quickl::Delegate(__FILE__, __LINE__)

  # Single command version
  VERSION = "0.1.0"
  
  # Install options
  options do |opt|
    
    # Show the help and exit
    opt.on_tail("--help", "Show help") do
      raise Quickl::Help
    end

    # Show version and exit
    opt.on_tail("--version", "Show version") do
      raise Quickl::Exit, "#{program_name} #{VERSION} (c) 2010, Bernard Lambeau"
    end

  end

end # class Delegate
require "help"
require "hello_world"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quickl-0.1.1 examples/delegate/lib/delegate.rb