class

Lolcat::CLI

Inherits Lolcat::Lol < Reference < Object

Command Line Interface for the lolcat program.

This class handles the command line interface, including parsing arguments, executing the appropriate action, and handling errors.

Constructors

new

Initializes the CLI with a parser and default options.

Sets up a termination handler to reset terminal modes when the program is interrupted.

Source

Class methods

debug=(debug : Bool)

Whether to enable debug mode (shows stack traces on errors)

Source
debug?

Whether to enable debug mode (shows stack traces on errors)

Source

Instance methods

option

The options parsed from command line arguments

Source
parse_args(args = ARGV)

Parses command line arguments and updates the options.

args: The command line arguments to parse (defaults to ARGV)

Returns the updated options

Source
parser

The command line argument parser

Source
run

Runs the program with the parsed options.

This is the main entry point that executes the appropriate action based on the parsed command line arguments.

Source
run_lolcat

Executes the main lolcat functionality.

Processes input from ARGF (files specified on the command line or stdin) and displays it with rainbow colors.

Source