Class: Pvectl::CLI

Inherits:
Object
  • Object
show all
Extended by:
GLI::App
Defined in:
lib/pvectl/cli.rb,
sig/pvectl/cli.rbs

Overview

Main CLI class using the GLI framework.

The CLI class is the entry point for the pvectl command line interface. It is responsible for:

  • Defining global flags and options
  • Loading commands via PluginLoader (built-in + plugins)
  • Error handling and system signal handling

Uses the GLI (Git-Like Interface) framework to create commands in kubectl/git style.

Examples:

Running CLI

Pvectl::CLI.run(ARGV)

Typical command line usage

pvectl get nodes                    # List nodes
pvectl get vms -o json              # List VMs in JSON format
pvectl describe vm 100 --verbose    # VM details with debugging

See Also:

Class Method Summary collapse

Class Method Details

.arg_namevoid

This method returns an undefined value.

Parameters:

  • name (String)


12
# File 'sig/pvectl/cli.rbs', line 12

def self.arg_name: (String name) -> void

.default_valuevoid

This method returns an undefined value.

Parameters:

  • value (Object)


14
# File 'sig/pvectl/cli.rbs', line 14

def self.default_value: (untyped value) -> void

.descvoid

This method returns an undefined value.

Parameters:

  • description (String)


10
# File 'sig/pvectl/cli.rbs', line 10

def self.desc: (String description) -> void

.flagvoid

This method returns an undefined value.

Parameters:

  • names (Array[Symbol])
  • options (Object)


16
# File 'sig/pvectl/cli.rbs', line 16

def self.flag: (Array[Symbol] names, **untyped options) -> void

.on_error {|arg0| ... } ⇒ void

This method returns an undefined value.

Yields:

Yield Parameters:

  • arg0 (Exception)

Yield Returns:

  • (void)


20
# File 'sig/pvectl/cli.rbs', line 20

def self.on_error: () { (Exception) -> void } -> void

.program_descvoid

This method returns an undefined value.

GLI::App methods provided via extend

Parameters:

  • desc (String)


4
# File 'sig/pvectl/cli.rbs', line 4

def self.program_desc: (String desc) -> void

.runInteger

Parameters:

  • argv (Array[String])

Returns:

  • (Integer)


22
# File 'sig/pvectl/cli.rbs', line 22

def self.run: (Array[String] argv) -> Integer

.subcommand_option_handlingvoid

This method returns an undefined value.

Parameters:

  • mode (Symbol)


8
# File 'sig/pvectl/cli.rbs', line 8

def self.subcommand_option_handling: (Symbol mode) -> void

.switchvoid

This method returns an undefined value.

Parameters:

  • names (Array[Symbol])
  • options (Object)


18
# File 'sig/pvectl/cli.rbs', line 18

def self.switch: (Array[Symbol] names, **untyped options) -> void

.trap { ... } ⇒ void

This method returns an undefined value.

Parameters:

  • signal (String)

Yields:

Yield Returns:

  • (void)


24
# File 'sig/pvectl/cli.rbs', line 24

def self.trap: (String signal) { () -> void } -> void

.versionvoid

This method returns an undefined value.

Parameters:

  • version (String)


6
# File 'sig/pvectl/cli.rbs', line 6

def self.version: (String version) -> void