cli: don't allow multiple values for jj rebase and jj untrack

Somehow I had thought that setting `clap(required = true)` on a
list-type argument was not enough to convince clap to require at least
one occurrence, but it seems that it does. The `min_values = 1` I had
added to get it to work actually means that we accept multiple values
passed to a single argument (e.g. `jj rebase -d x y z`), which is not
what I had intended.
This commit is contained in:
Martin von Zweigbergk 2022-04-13 10:08:16 -07:00 committed by Martin von Zweigbergk
parent 677dea1682
commit c1e5f88780

View File

@ -1042,7 +1042,7 @@ struct CheckoutArgs {
#[derive(clap::Args, Clone, Debug)]
struct UntrackArgs {
/// Paths to untrack
#[clap(required = true, min_values = 1)]
#[clap(required = true)]
paths: Vec<String>,
}
@ -1422,7 +1422,7 @@ struct RebaseArgs {
#[clap(long, short)]
source: Option<String>,
/// The revision to rebase onto
#[clap(long, short, required = true, min_values = 1)]
#[clap(long, short, required = true)]
destination: Vec<String>,
}