fix(Completions): fixes bug where --help and --version short weren't added to the completion list

Closes #563
This commit is contained in:
Kevin K 2016-07-03 10:52:06 -04:00
parent 0b4ee665ad
commit cecfe981ea

View file

@ -1030,6 +1030,9 @@ impl<'a, 'b> Parser<'a, 'b>
help: Some("Prints help information"), help: Some("Prints help information"),
..Default::default() ..Default::default()
}; };
if let Some(h) = self.help_short {
self.short_list.push(h);
}
self.long_list.push("help"); self.long_list.push("help");
self.flags.push(arg); self.flags.push(arg);
} }
@ -1047,6 +1050,9 @@ impl<'a, 'b> Parser<'a, 'b>
help: Some("Prints version information"), help: Some("Prints version information"),
..Default::default() ..Default::default()
}; };
if let Some(v) = self.version_short {
self.short_list.push(v);
}
self.long_list.push("version"); self.long_list.push("version");
self.flags.push(arg); self.flags.push(arg);
} }