Skip to content

Commit 2060aba

Browse files
committed
fix(cli): addd strict constrain between cli arguments
- from-hash and to-hash are exclusive to : message, hash, file - to-hash requires from-hash and from-hash only
1 parent 5930b7e commit 2060aba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/cli.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ pub struct Cli {
2222
#[arg(long)]
2323
pub from_hash: Option<String>,
2424

25-
#[arg(long, requires = "from_hash", default_value = "HEAD")]
25+
#[arg(
26+
long, requires = "from_hash",
27+
conflicts_with_all = ["message", "file", "hash"],
28+
default_value = "HEAD"
29+
)]
2630
pub to_hash: Option<String>,
2731
}

0 commit comments

Comments
 (0)