Merge pull request #4401 from epage/last

fix(complete): Support last(true) with CommandWithArguments
This commit is contained in:
Ed Page 2022-10-18 07:41:02 -05:00 committed by GitHub
commit e11afa284b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -271,8 +271,8 @@ pub(crate) fn assert_app(cmd: &Command) {
);
assert!(
arg.is_trailing_var_arg_set(),
"Command {}: Positional argument '{}' has hint CommandWithArguments, so Command must have TrailingVarArg set.",
arg.is_trailing_var_arg_set() || arg.is_last_set(),
"Command {}: Positional argument '{}' has hint CommandWithArguments, so Command must have `trailing_var_arg(true)` or `last(true)` set.",
cmd.get_name(),
arg.get_id()
);