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)
| 429 | /// says the argument is optional and names the current view as the value to |
| 430 | /// simply drop in — or the value to leave off entirely. |
| 431 | fn require_view(repo: &Repository, name: &str, arg: &str) -> CliResult<()> { |
| 432 | if repo.view_exists(name).map_err(CliError::Repository)? { |
| 433 | Ok(()) |
| 434 | } else { |
| 435 | Err(unknown_view(repo, name, arg)) |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | /// The error for a view name that does not resolve. |
| 440 | fn unknown_view(repo: &Repository, name: &str, arg: &str) -> CliError { |
no test coverage detected