Class: Runoff::Commandline::None
- Inherits:
-
Object
- Object
- Runoff::Commandline::None
- Defined in:
- lib/runoff/commandline/none.rb
Overview
Public: The default class that is used when the executable is called
without any commands.
Examples
command = None.new { archive: false }
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Public: Returns an OptionParser object.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ None
constructor
Public: initialize a new None command object.
Constructor Details
#initialize(options = {}) ⇒ None
Public: initialize a new None command object.
options - A Hash of commandline options (default { archive: false }).
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/runoff/commandline/none.rb', line 20 def initialize( = {}) @option = @parser = OptionParser.new do |opts| opts. = <<END runoff - a simple application to create Skype backups Usage: runoff <COMMAND> [SKYPE_USERNAME] [OPTIONS] Commands: all - Exports all chats some - Exports only specified chats Options: END opts.on '-h', '--help', 'Displays help' do puts opts exit end opts.on '-v', '--version', 'Displays a version number' do puts Runoff::VERSION exit end end end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Public: Returns an OptionParser object
15 16 17 |
# File 'lib/runoff/commandline/none.rb', line 15 def parser @parser end |