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 and validates worktree configuration. Shows current settings, configuration file locations, 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
19 20 21 |
# File 'lib/ace/git/worktree/commands/config_command.rb', line 19 def initialize @manager = Organisms::WorktreeManager.new end |
Instance Method Details
#run(args = []) ⇒ Integer
Run the config command
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 |
# File 'lib/ace/git/worktree/commands/config_command.rb', line 27 def run(args = []) = parse_arguments(args) return show_help if [:help] # Default to showing configuration if no action specified [:show] = true unless [:validate] || [:show] || [:files] () results = [] if [:show] results << show_configuration end if [:validate] results << validate_configuration end if [:files] results << show_configuration_files end # Return success if all operations succeeded (results.all? { |result| result == 0 }) ? 0 : 1 rescue ArgumentError => e puts "Error: #{e.}" puts show_help 1 rescue => e puts "Error: #{e.}" 1 end |
#show_help ⇒ Integer
Show help for the config command
65 66 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/ace/git/worktree/commands/config_command.rb', line 65 def show_help puts <<~HELP ace-git-worktree config - Manage worktree configuration USAGE: ace-git-worktree config [OPTIONS] ACTIONS: --show Show current configuration (default) --validate Validate configuration --files Show configuration file locations OPTIONS: --verbose, -v Show detailed information --help, -h Show this help message EXAMPLES: # Show current configuration ace-git-worktree config ace-git-worktree config --show # Validate configuration ace-git-worktree config --validate # Show configuration file locations ace-git-worktree config --files # Show everything ace-git-worktree config --show --validate --files CONFIGURATION FILES: .ace/git/worktree.yml Project-specific configuration .ace-defaults/git/worktree.yml Example configuration template ~/.ace/git/worktree.yml User-specific configuration CONFIGURATION OPTIONS: git.worktree.root_path Worktree root directory git.worktree.mise_trust_auto Automatic mise trust git.worktree.task.* Task-related settings git.worktree.cleanup.* Cleanup behavior settings VALIDATION: Checks for: • Valid configuration structure • Required configuration fields • Accessible worktree root directory • Valid template variables • Consistent settings For configuration examples, see .ace-defaults/git/worktree.yml HELP 0 end |