mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
added check for -
This commit is contained in:
parent
6422930a18
commit
8b2a9928e8
1 changed files with 4 additions and 0 deletions
|
@ -269,6 +269,10 @@ impl<'help> Arg<'help> {
|
||||||
/// ```
|
/// ```
|
||||||
/// [`short`]: ./struct.Arg.html#method.short
|
/// [`short`]: ./struct.Arg.html#method.short
|
||||||
pub fn short(mut self, s: char) -> Self {
|
pub fn short(mut self, s: char) -> Self {
|
||||||
|
if s == '-' {
|
||||||
|
panic!("Invalid option character");
|
||||||
|
}
|
||||||
|
|
||||||
self.short = Some(s);
|
self.short = Some(s);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue