Fail with an actionable message when a triage view argument names a view that does not exist. The usual cause is typing the placeholder from the help text (`atomic triage review feature`) instead of a real view name, so the message says the argument is optional and names the current view as the value to simply drop in — or the value to leave off entirely.
(repo: &Repository, name: &str, arg: &str)
| 322 | /// says the argument is optional and names the current view as the value to |
| 323 | /// simply drop in — or the value to leave off entirely. |
| 324 | fn require_view(repo: &Repository, name: &str, arg: &str) -> CliResult<()> { |
| 325 | if repo.view_exists(name).map_err(CliError::Repository)? { |
| 326 | Ok(()) |
| 327 | } else { |
| 328 | Err(unknown_view(repo, name, arg)) |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | /// The error for a view name that does not resolve. |
| 333 | fn unknown_view(repo: &Repository, name: &str, arg: &str) -> CliError { |
no test coverage detected