Class: CreateGithubRelease::CommandLine::Parser

Inherits:
CommandLineBoss
  • Object
show all
Defined in:
lib/create_github_release/command_line/parser.rb

Overview

Parses the options for this script

Examples:

Specify the release type

options = CommandLineParser.new.parse('major')
options.valid? # => true
options.release_type # => "major"
options.quiet # => false

Specify the release type and the quiet option

parser = CommandLineParser.new
args = %w[minor --quiet]
options = parser.parse(*args)
options.release_type # => "minor"
options.quiet # => true

Show the command line help

CommandLineParser.new.parse('--help')
parser.parse('--help')

Instance Attribute Summary collapse

Instance Attribute Details

#optionsCreateGithubRelease::CommandLine::Options (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The options to used for the create-github-release script

Examples:

parser = CommandLineParser.new
parser.parse(['major'])
options = parser.options
options.release_type # => 'major'

Returns:



46
47
48
# File 'lib/create_github_release/command_line/parser.rb', line 46

def options
  @options
end