mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
fix: fixes compilation errors form cherry picked commits
This commit is contained in:
parent
24d5fb3202
commit
df35813d17
2 changed files with 8 additions and 9 deletions
|
@ -5,7 +5,6 @@ use std::io::{self, BufWriter, Write};
|
|||
use std::os::unix::ffi::OsStrExt;
|
||||
#[cfg(all(feature = "debug", any(target_os = "windows", target_arch = "wasm32")))]
|
||||
use osstringext::OsStrExt3;
|
||||
use std::path::PathBuf;
|
||||
use std::slice::Iter;
|
||||
use std::iter::Peekable;
|
||||
use std::mem;
|
||||
|
@ -799,7 +798,7 @@ where
|
|||
// Is this a new argument, or values from a previous option?
|
||||
let mut ret = if arg_os.starts_with(b"--") {
|
||||
debugln!("Parser::is_new_arg: -- found");
|
||||
if arg_os.len_() == 2 && !arg_allows_tac {
|
||||
if arg_os.len() == 2 && !arg_allows_tac {
|
||||
return true; // We have to return true so override everything else
|
||||
} else if arg_allows_tac {
|
||||
return false;
|
||||
|
@ -808,7 +807,7 @@ where
|
|||
} else if arg_os.starts_with(b"-") {
|
||||
debugln!("Parser::is_new_arg: - found");
|
||||
// a singe '-' by itself is a value and typically means "stdin" on unix systems
|
||||
!(arg_os.len_() == 1)
|
||||
!(arg_os.len() == 1)
|
||||
} else {
|
||||
debugln!("Parser::is_new_arg: probably value");
|
||||
false
|
||||
|
|
|
@ -109,7 +109,7 @@ impl<'a, 'b, 'c, 'z> Validator<'a, 'b, 'c, 'z> {
|
|||
));
|
||||
}
|
||||
}
|
||||
if !arg.is_set(ArgSettings::EmptyValues) && val.is_empty()
|
||||
if !arg.is_set(ArgSettings::AllowEmptyValues) && val.is_empty()
|
||||
&& matcher.contains(&*arg.name)
|
||||
{
|
||||
debugln!("Validator::validate_arg_values: illegal empty val found");
|
||||
|
|
Loading…
Reference in a new issue