mirror of
https://github.com/clap-rs/clap
synced 2024-12-15 07:12:32 +00:00
Merge #1657
1657: added check for - r=CreepySkeleton a=Toothless204 Address #1600 Co-authored-by: Toothless204 <38069888+Toothless204@users.noreply.github.com>
This commit is contained in:
commit
526fd73ded
1 changed files with 4 additions and 0 deletions
|
@ -269,6 +269,10 @@ impl<'help> Arg<'help> {
|
|||
/// ```
|
||||
/// [`short`]: ./struct.Arg.html#method.short
|
||||
pub fn short(mut self, s: char) -> Self {
|
||||
if s == '-' {
|
||||
panic!("short option name cannot be `-`");
|
||||
}
|
||||
|
||||
self.short = Some(s);
|
||||
self
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue