Class: Factorix::CLI::Commands::Base
- Inherits:
-
Dry::CLI::Command
- Object
- Dry::CLI::Command
- Factorix::CLI::Commands::Base
- Defined in:
- lib/factorix/cli/commands/base.rb
Overview
Base class for all CLI commands
This class provides common functionality for all commands:
-
Common options (–config-path, –log-level, –quiet)
-
Common helper methods (say, quiet?)
-
Pre-call setup and error handling (via CommandWrapper prepended module)
All command classes should inherit from this base class instead of directly from Dry::CLI::Command.
Direct Known Subclasses
Factorix::CLI::Commands::Blueprint::Decode, Factorix::CLI::Commands::Blueprint::Encode, Cache::Evict, Cache::Stat, Completion, Download, Launch, MOD::Changelog::Add, MOD::Changelog::Check, MOD::Changelog::Extract, MOD::Changelog::Release, MOD::Check, MOD::Disable, MOD::Download, MOD::Edit, MOD::Enable, MOD::Image::Add, MOD::Image::Edit, MOD::Image::List, MOD::Install, MOD::List, MOD::Search, MOD::Settings::Dump, MOD::Settings::Restore, MOD::Show, MOD::Sync, MOD::Uninstall, MOD::Update, MOD::Upload, Man, Path, Version
Class Method Summary collapse
-
.backup_support! ⇒ void
Enable backup support for file modifications.
-
.confirmable! ⇒ void
Enable confirmation prompts with –yes option.
-
.inherited(subclass) ⇒ Object
Prepend CommandWrapper to each command class that inherits from Base.
-
.require_game_stopped! ⇒ void
Require that the game is not running when this command executes.
Class Method Details
.backup_support! ⇒ void
This method returns an undefined value.
Enable backup support for file modifications
68 |
# File 'lib/factorix/cli/commands/base.rb', line 68 def self.backup_support! = prepend BackupSupport |
.confirmable! ⇒ void
This method returns an undefined value.
Enable confirmation prompts with –yes option
64 |
# File 'lib/factorix/cli/commands/base.rb', line 64 def self.confirmable! = prepend Confirmable |
.inherited(subclass) ⇒ Object
Prepend CommandWrapper to each command class that inherits from Base
53 54 55 56 |
# File 'lib/factorix/cli/commands/base.rb', line 53 def self.inherited(subclass) super subclass.prepend CommandWrapper end |
.require_game_stopped! ⇒ void
This method returns an undefined value.
Require that the game is not running when this command executes
60 |
# File 'lib/factorix/cli/commands/base.rb', line 60 def self.require_game_stopped! = prepend RequiresGameStopped |