Class: Factorix::CLI::Commands::Completion
- Defined in:
- lib/factorix/cli/commands/completion.rb
Overview
Generate shell completion script for factorix
This command outputs a shell completion script that can be evaluated to enable command-line completion for factorix.
Instance Method Summary collapse
-
#call(shell: nil) ⇒ void
Execute the completion command.
Methods inherited from Base
backup_support!, confirmable!, inherited, require_game_stopped!
Instance Method Details
#call(shell: nil) ⇒ void
This method returns an undefined value.
Execute the completion command
48 49 50 51 52 53 54 55 56 |
# File 'lib/factorix/cli/commands/completion.rb', line 48 def call(shell: nil, **) shell_type = shell || detect_shell validate_shell!(shell_type) script_path = COMPLETION_DIR / SUPPORTED_SHELLS[shell_type] raise ConfigurationError, "#{shell_type.capitalize} completion script not found" unless script_path.exist? out.puts script_path.read end |