Class: Ace::Git::Worktree::Commands::ConfigCommand
- Inherits:
-
Object
- Object
- Ace::Git::Worktree::Commands::ConfigCommand
- Defined in:
- lib/ace/git/worktree/commands/config_command.rb
Overview
Config command
Displays, initializes, updates, and validates worktree configuration. Shows current settings, provenance tracking, and validation results.
Instance Method Summary collapse
-
#initialize ⇒ ConfigCommand
constructor
Initialize a new ConfigCommand.
-
#run(args = []) ⇒ Integer
Run the config command.
-
#show_help ⇒ Integer
Show help for the config command.
Constructor Details
#initialize ⇒ ConfigCommand
Initialize a new ConfigCommand
18 19 20 |
# File 'lib/ace/git/worktree/commands/config_command.rb', line 18 def initialize @manager = Organisms::WorktreeManager.new end |
Instance Method Details
#run(args = []) ⇒ Integer
Run the config command
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ace/git/worktree/commands/config_command.rb', line 26 def run(args = []) = parse_arguments(args) return show_help if [:help] if [:init] return init_project_config end if [:set_bootstrap] return set_bootstrap_config() end # Default to showing configuration if no action specified [:show] = true unless [:validate] || [:show] || [:files] results = [] if [:show] results << show_configuration(json: [:json]) end if [:validate] results << validate_configuration(bootstrap_only: [:bootstrap], json: [:json]) end if [:files] results << show_configuration_files end (results.all? { |result| result == 0 }) ? 0 : 1 rescue ArgumentError => e puts "Error: #{e.}" 1 rescue => e puts "Error: #{e.}" 1 end |
#show_help ⇒ Integer
Show help for the config command
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/ace/git/worktree/commands/config_command.rb', line 67 def show_help puts <<~HELP ace-git-worktree config - Manage worktree configuration USAGE: ace-git-worktree config [SUBCOMMAND / OPTIONS] ACTIONS: init Initialize minimal project worktree configuration set-bootstrap Set bootstrap command policy --show Show current configuration (default) --validate Validate configuration --files Show configuration file locations SET BOOTSTRAP OPTIONS: --command <cmd> Command to run --working-dir <path> Working directory relative to project root --timeout <sec> Timeout in seconds (max 300) --required | --advisory Policy for execution failure --env KEY=VALUE Environment variables FORMAT OPTIONS: --json Format output as JSON --bootstrap Validate bootstrap section only EXAMPLES: ace-git-worktree config init ace-git-worktree config set-bootstrap --command "npm install" --timeout 120 --required ace-git-worktree config show --json ace-git-worktree config validate --bootstrap --json HELP 0 end |