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:
bors[bot] 2020-02-02 16:51:19 +00:00 committed by GitHub
commit 526fd73ded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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!("short option name cannot be `-`");
}
self.short = Some(s); self.short = Some(s);
self self
} }