Path: | lib/more/facets/command.rb |
Last Update: | Tue Oct 28 06:39:06 -0400 2008 |
Here is an example of usage:
# General Options module GeneralOptions attr_accessor :dryrun ; alias_accessor :n, :noharm, :dryrun attr_accessor :quiet ; alias_accessor :q, :quiet attr_accessor :force attr_accessor :trace end # Build Subcommand class BuildCommand < CLI::Command include GeneralOptions # metadata files attr_accessor :file ; alias_accessor :f, :file attr_accessor :manifest ; alias_accessor :m, :manifest def call # do stuf here end end # Box Master Command class BoxCommand < CLI::Command subcommand :build, BuildCommand end BoxCommand.start
Copyright (c) 2005,2008 Thomas Sawyer
Ruby License
This module is free software. You may use, modify, and/or redistribute this software under the same terms as Ruby.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.