diff options
Diffstat (limited to 'lib/cli.rb')
| -rw-r--r-- | lib/cli.rb | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -2,12 +2,19 @@ require_relative 'action_file_executor' +# CLI class to handle command-line interface operations. class CLI + # Initializes the CLI with command-line arguments. + # + # @param args [Array<String>] The command-line arguments. def initialize(args) @args = args validate_arguments end + # Runs the CLI, executing actions from the provided file. + # + # @return [void] def run file_path = @args[0] action_file_executor = ActionFileExecutor.new(file_path) @@ -16,6 +23,10 @@ class CLI private + # Validates the command-line arguments. + # + # @return [void] + # @raise [SystemExit] if no arguments are provided or the file does not exist. def validate_arguments if @args.empty? puts 'Usage: family_tree <path/to/actions.txt>' |
