Cuprum::Cli

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

Module: Cuprum::Cli::Metadata::ClassMethods

Parent Namespace
Cuprum::Cli::Metadata
Defined In
lib/cuprum/cli/metadata.rb

Table Of Contents

Overview

Class methods to extend when including Metadata.

Back To Top

Instance Methods

#abstract => Object

Marks the command as abstract.

#abstract? => true, false

Returns

#description => String
#description(value) => String

Overloads

#description => String
Returns
  • (String) — the description for the command.
#description(value) => String

Sets the description for the command.

Parameters
  • value (String) — the description to set.
Returns
  • (String) — the set description.

#description? => true, false

Returns

#full_description => String
#full_description(value) => String

Overloads

#full_description => String
Returns
  • (String) — the full description for the command.
#full_description(value) => String

Sets the full description for the command.

Parameters
  • value (String) — the full description to set.
Returns
  • (String) — the set full description.

#full_description? => true, false

Returns

#full_name => String
#full_name(value) => String

Overloads

#full_name => String

Returns the name of the command, used when calling from a CLI.

Unless another value is set, defaults to the class name of the command with the following format:

  • Removes the “Commands” namespace and any prior namespace, if any.
  • Removes a “Command” suffix, if any.
  • Converts each remaining segment to snake_case and joins with “:”.
Returns
  • (String) — the scoped name for the command.
#full_name(value) => String

Sets the full name for the command.

The full name must be in snake_case format joined by “:”.

Parameters
  • value (String) — the full name to set.
Returns
  • (String) — the set full name.

#namespace => String, nil

The namespace for the command.

A command’s namespace is defined as the part of the full name prior to the last segment.

Returns

See Also

#namespace? => true, false

Returns

#short_name => String

The short name for the command.

A command’s short_name is the last segment of the full name.

Returns

Back To Top


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