Trait that all CLI commands must implement. This trait provides a uniform interface for executing commands, enabling consistent error handling and testing across all commands. # Implementing Commands Each command should: 1. Parse and validate its arguments in the struct fields 2. Implement `run()` to perform the actual operation 3. Return appropriate errors using [`CliError`] # Example ```rus
| 197 | /// } |
| 198 | /// ``` |
| 199 | pub trait Command { |
| 200 | /// Execute the command. |
| 201 | /// |
| 202 | /// This method performs the main logic of the command. It should: |
| 203 | /// - Validate any preconditions |
| 204 | /// - Perform the requested operation |
| 205 | /// - Print appropriate output to the user |
| 206 | /// - Return errors using [`CliError`] for consistent error handling |
| 207 | /// |
| 208 | /// # Errors |
| 209 | /// |
| 210 | /// Returns a [`CliError`] if the command fails for any reason. |
| 211 | /// The error should be as specific as possible to help users |
| 212 | /// understand what went wrong and how to fix it. |
| 213 | fn run(&self) -> CliResult<()>; |
| 214 | } |
| 215 | |
| 216 | // Repository Discovery |
| 217 |
nothing calls this directly
no outgoing calls
no test coverage detected