mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 14:54:15 +00:00
Fixes #9
This commit is contained in:
parent
f75e019b5e
commit
6ae91954ae
2 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
|
||||
name = "clap"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
authors = ["Kevin K. <kbknapp@gmail.com>"]
|
||||
exclude = ["docs/*"]
|
||||
description = "A Command Line Argument Parser written in Rust"
|
||||
|
|
|
@ -762,7 +762,7 @@ impl App {
|
|||
// Single flag, or option long version
|
||||
needs_val_of = self.parse_long_arg(matches, &arg);
|
||||
|
||||
} else if arg_slice.starts_with("-") {
|
||||
} else if arg_slice.starts_with("-") && arg_slice.len() != 1 {
|
||||
needs_val_of = self.parse_short_arg(matches, &arg);
|
||||
} else {
|
||||
// Positional or Subcommand
|
||||
|
@ -774,7 +774,7 @@ impl App {
|
|||
break;
|
||||
}
|
||||
|
||||
if self.positionals_idx.is_empty() { // || self.positionals_name.is_empty() {
|
||||
if self.positionals_idx.is_empty() {
|
||||
self.report_error(
|
||||
format!("Found positional argument {}, but {} doesn't accept any", arg, self.name),
|
||||
true, true);
|
||||
|
|
Loading…
Reference in a new issue