execute performs the main logic for integration.
()
| 54 | |
| 55 | // execute performs the main logic for integration. |
| 56 | func (i *integrateCmd) execute() error { |
| 57 | shell := i.detectShell() |
| 58 | |
| 59 | // Validate environment. |
| 60 | if err := i.validateEnvironment(shell); err != nil { |
| 61 | return fmt.Errorf("environment validation failed -> %w", err) |
| 62 | } |
| 63 | |
| 64 | // Initialize completions. |
| 65 | if err := i.initializeCompletions(); err != nil { |
| 66 | return fmt.Errorf("failed to initialize completion handlers -> %w", err) |
| 67 | } |
| 68 | |
| 69 | // Execute the requested operation. |
| 70 | if i.remove { |
| 71 | return i.handleUnregister(shell) |
| 72 | } |
| 73 | return i.handleRegister(shell) |
| 74 | } |
| 75 | |
| 76 | func (i *integrateCmd) detectShell() (shell completion.ShellType) { |
| 77 | shell = completion.NotSupported |
no test coverage detected