Class: Synoption::BooleanOption

Inherits:
Option show all
Defined in:
lib/synoption/boolean_option.rb

Overview

a boolean option maps to a single tag, not a tag and value. For example, ā€œ-vā€ (verbose) is a boolean option, but ā€œ-r 3444ā€ (revision) is a option with a value.

Constant Summary

Constants inherited from BaseOption

Synoption::BaseOption::NO_CMDLINE_OPTION

Instance Attribute Summary

Attributes inherited from BaseOption

#default, #description, #name, #negate, #regexp, #tag

Instance Method Summary collapse

Methods inherited from BaseOption

#exact_match?, #initialize, #negative_match?, #next_argument, #post_process, #process, #regexp_match?, #resolve_value, #set_value, #to_doc, #to_s, #unset, #value

Constructor Details

This class inherits a constructor from Synoption::BaseOption

Instance Method Details

#takes_value?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/synoption/boolean_option.rb', line 11

def takes_value?
  false
end

#to_command_lineObject



15
16
17
# File 'lib/synoption/boolean_option.rb', line 15

def to_command_line
  super && [ tag ]
end