Tighten argument matching

This commit is contained in:
Robin Avery 2024-02-29 18:57:01 -05:00
parent 5fd74583fa
commit 90ccc21f0d
No known key found for this signature in database
GPG Key ID: 633B2D5AB640375C
1 changed files with 3 additions and 2 deletions

View File

@ -53,8 +53,8 @@ pub struct Args {
pub fn run(args: Args) -> Result<()> {
let (target_path, base_path, project_config) =
match (&args.target, &args.base, &args.project, &args.unit) {
(Some(t), Some(b), _, _) => (Some(t.clone()), Some(b.clone()), None),
(_, _, p, u) => {
(Some(t), Some(b), None, None) => (Some(t.clone()), Some(b.clone()), None),
(None, None, p, u) => {
let project = match p {
Some(project) => project.clone(),
_ => std::env::current_dir().context("Failed to get the current directory")?,
@ -114,6 +114,7 @@ pub fn run(args: Args) -> Result<()> {
let base_path = object.base_path.clone();
(target_path, base_path, Some(project_config))
}
_ => bail!("Either target and base or project and unit must be specified"),
};
let mut state = FunctionDiffUi {
clear: true,