Cuprum::Cli

A command-line utility powered by Cuprum that provides tools and utilities for defining command-line tools.

Class: Cuprum::Cli::Argument

Parent Namespace
Cuprum::Cli
Inherited Classes
Data > Object
Defined In
lib/cuprum/cli/argument.rb

Table Of Contents

Overview

Data object representing a positional command argument.

Back To Top

Constructor

#initialize(name:, default: nil, description: nil, parameter_name: nil, required: false, type: :string, variadic: false) => Argument

Parameters

Returns

Back To Top

Instance Attributes

#default => Object (readonly)

Returns the value of attribute default

Returns

#description => Object (readonly)

Returns the value of attribute description

Returns

#name => Object (readonly)

Returns the value of attribute name

Returns

#parameter_name => Object (readonly)

Returns the value of attribute parameter_name

Returns

#required => Object (readonly)

Also known as: required?

Returns the value of attribute required

Returns

#type => Object (readonly)

Returns the value of attribute type

Returns

#variadic => Object (readonly)

Also known as: variadic?

Returns the value of attribute variadic

Returns

Back To Top

Instance Methods

#resolve(value) => Object

Overloads

#resolve(value) => Object

Validates the value for the current argument.

If the value is nil, applies the argument default (if any).

Parameters
  • value (Object) — the value to validate.
Returns
  • (Object) — the validated argument value.
Raises

Raises

Back To Top


Back to Documentation | Reference | Cuprum | Cuprum::Cli