Class: OptionParser
- Inherits:
-
Object
- Object
- OptionParser
- Defined in:
- lib/options.rb
Overview
define global default option definitions
Instance Method Summary collapse
Instance Method Details
#add_default(opts) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/options.rb', line 11 def add_default(opts) self.separator "" self.on("-n", "--new", "Create a new code generator stub in ~/.lepidoptera") do opts[:new] = true end self.on("-q", "--quiet", "Suppress status output") do opts[:quiet] = true end self.on("-g", "--git", "Create a git repository after code generation") do opts[:gitinit] = true end # self.on("-s", "--svn [URL]", "Initial import into a given svn repository") do |url| # opts[:svnimport] = url # end # self.on("-l", "--list", "List all code generators") do # opts[:list] = true # end self.on("-h", "--help", "Show help") do puts self exit end self.separator "" self.define_head "Version #{Butterfly::VERSION}" self.define_head "A life-enhancing code generator for everyday use." self.define_head "" end |