Resolves a CLI path argument to an absolute `PathBuf`. If `path` is `Some`, uses that value; otherwise falls back to the current working directory.
(path: Option<String>)
| 618 | /// If `path` is `Some`, uses that value; otherwise falls back to the current |
| 619 | /// working directory. |
| 620 | pub fn resolve_path(path: Option<String>) -> PathBuf { |
| 621 | let path = match path { |
| 622 | Some(p) => PathBuf::from(p), |
| 623 | None => std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")), |
| 624 | }; |
| 625 | absolutize_path(path) |
| 626 | } |
| 627 | |
| 628 | fn absolutize_path(path: PathBuf) -> PathBuf { |
| 629 | if path.is_absolute() { |