added check for -

This commit is contained in:
Toothless204 2020-02-02 11:48:35 +00:00
parent 6422930a18
commit 8b2a9928e8

View file

@ -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!("Invalid option character");
}
self.short = Some(s);
self
}