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

Issue:
Panic when passing `--=` as argument
### 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

### Rust Version

rustc 1.63.0-nightly (546c826f0 2022-06-12)

### Clap Version

git+https://github.com/clap-rs/clap#dabb5713d4d60b52deaef21c42c9d9dae57f5def

### Minimal reproducible code

```rust
use clap::Parser;

#[derive(Parser)]
#[clap()]
pub struct Options {
}

fn main() {
    let mut options = Options::parse();
}
```


### Steps to reproduce the bug with the above code

```
cargo run -- --=

### Actual Behaviour

```
thread 'main' panicked at 'Some(RawOsStr(""))', /home/undeadleech/.cargo/git/checkouts/clap-78dbe9b58f9073fe/dabb571/src/parser/parser.rs:741:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

### Expected Behaviour

I'd expect an error similar to any other of clap's errors indicating that the arguments passed weren't quite right. It shouldn't crash the parser.

### Additional Context

Kinda ran into this by accident, I have no reason why I would want this to work, but avoiding a crash seems sensible.

### Debug Output

_No response_


Discussion / hints:

Fix patch:
diff --git a/src/parser/parser.rs b/src/parser/parser.rs
index fc95dad222f..2352eff6a27 100644
--- a/src/parser/parser.rs
+++ b/src/parser/parser.rs
@@ -738,8 +738,10 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
             }
         };
         if long_arg.is_empty() {
-            debug_assert!(long_value.is_none(), "{:?}", long_value);
-            return Ok(ParseResult::NoArg);
+            debug_assert!(
+                long_value.is_some(),
+                "`--` should be filtered out before this point"
+            );
         }
 
         let arg = if let Some(arg) = self.cmd.get_keymap().get(long_arg) {


Test patch: