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
| 228 | /// } |
| 229 | /// ``` |
| 230 | pub trait Command { |
| 231 | /// Execute the command. |
| 232 | /// |
| 233 | /// This method performs the main logic of the command. It should: |
| 234 | /// - Validate any preconditions |
| 235 | /// - Perform the requested operation |
| 236 | /// - Print appropriate output to the user |
| 237 | /// - Return errors using [`CliError`] for consistent error handling |
| 238 | /// |
| 239 | /// # Errors |
| 240 | /// |
| 241 | /// Returns a [`CliError`] if the command fails for any reason. |
| 242 | /// The error should be as specific as possible to help users |
| 243 | /// understand what went wrong and how to fix it. |
| 244 | fn run(&self) -> CliResult<()>; |
| 245 | } |
| 246 | |
| 247 | // Repository Discovery |
| 248 |
nothing calls this directly
no outgoing calls
no test coverage detected