Class: Toys::ArgParser::FlagValueMissingError

Inherits:
UsageError
  • Object
show all
Defined in:
lib/toys/arg_parser.rb

Overview

A UsageError indicating a value was not provided for a flag that requires a value.

Instance Attribute Summary

Attributes inherited from UsageError

#message, #name, #suggestions, #value

Instance Method Summary collapse

Methods inherited from UsageError

#full_message

Constructor Details

#initialize(message = nil, name: nil) ⇒ FlagValueMissingError

Create a FlagValueMissingError.

Parameters:

  • message (String, nil) (defaults to: nil)

    A custom message. Normally omitted, in which case an appropriate default is supplied.

  • name (String) (defaults to: nil)

    The name of the flag. Normally required.



114
115
116
# File 'lib/toys/arg_parser.rb', line 114

def initialize(message = nil, name: nil)
  super(message || "Flag \"#{name}\" is missing a value.", name: name)
end