Class: Factorix::CLI::Commands::Man

Inherits:
Base
  • Object
show all
Defined in:
lib/factorix/cli/commands/man.rb

Overview

Display the Factorix manual page

This command opens the man page for factorix using the system’s man command.

Examples:

$ factorix man

Instance Method Summary collapse

Methods inherited from Base

backup_support!, confirmable!, inherited, require_game_stopped!

Instance Method Details

#callvoid

This method returns an undefined value.

Execute the man command

Raises:



19
20
21
22
23
24
25
# File 'lib/factorix/cli/commands/man.rb', line 19

def call(**)
  system("command -v man > /dev/null 2>&1")
  raise CommandNotFoundError, "man command is not available on this system" unless $?.success?

  man_page = File.expand_path("../../../../doc/factorix.1", __dir__)
  exec "man", man_page
end