Class: Ukiryu::CliCommands::ExtractCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/ukiryu/cli_commands/extract_command.rb

Overview

Extract tool definition from an installed CLI tool

This command attempts to extract a tool definition by:

  1. Trying the tool’s native –ukiryu-definition flag

  2. Parsing the tool’s –help output as a fallback

Instance Attribute Summary

Attributes inherited from BaseCommand

#config, #options

Instance Method Summary collapse

Methods inherited from BaseCommand

#apply_cli_options_to_config, #default_register_path, #initialize, #setup_register, #stringify_keys

Constructor Details

This class inherits a constructor from Ukiryu::CliCommands::BaseCommand

Instance Method Details

#run(tool_name) ⇒ Object

Execute the extract command

Parameters:

  • tool_name (String)

    the tool name to extract definition from



14
15
16
17
18
19
20
21
22
# File 'lib/ukiryu/cli_commands/extract_command.rb', line 14

def run(tool_name)
  result = Ukiryu::Extractors::Extractor.extract(tool_name, extract_options)

  if result[:success]
    output_result(result)
  else
    handle_failure(result)
  end
end