Repository: clap-rs/clap (language: rust)

Issue:
Allow using `ValueHint::CommandWithArguments` with `last` (without `trailing_var_args`)
### Please complete the following tasks

- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=is%3Aissue+label%3AS-wont-fix+is%3Aclosed) issues

### Clap Version

4.0.15

### Describe your use case

I want to a program like this:

```sh
my_cli file1 file2 -- command_name arg1 arg2
```

I also want to generate ZSH completions.

However, `ValueHint::CommandWithArguments` requires the use of `trailing_var_args` which can't be used with `last`.

### Describe the solution you'd like

This code should be valid:

```rust
#[derive(Parser)]
struct MyCli {
  files: Vec<PathBuf>,
  #[clap(last = true, value_hint = ValueHint::CommandWithArguments)]
  command: Vec<OsString>,
}
```

### Alternatives, if applicable

_No response_

### Additional Context

_No response_


Discussion / hints:

Fix patch:
diff --git a/src/builder/debug_asserts.rs b/src/builder/debug_asserts.rs
index d14e22b442e..dff70e30fa7 100644
--- a/src/builder/debug_asserts.rs
+++ b/src/builder/debug_asserts.rs
@@ -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()
             );


Test patch: