From 8b2a9928e80ecfa0b4a5f4fff2be6e154aea3780 Mon Sep 17 00:00:00 2001 From: Toothless204 <38069888+Toothless204@users.noreply.github.com> Date: Sun, 2 Feb 2020 11:48:35 +0000 Subject: [PATCH] added check for - --- src/build/arg/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/build/arg/mod.rs b/src/build/arg/mod.rs index 060b202d..bfefc1a4 100644 --- a/src/build/arg/mod.rs +++ b/src/build/arg/mod.rs @@ -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 }