mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 00:27:13 +00:00
Fix a bug we didn't know about
This commit is contained in:
parent
c9e03e7e67
commit
312432a5db
2 changed files with 4 additions and 3 deletions
|
@ -276,7 +276,7 @@ impl<'b, 'c, 'z> Validator<'b, 'c, 'z> {
|
|||
fn gather_conflicts(&mut self, matcher: &mut ArgMatcher) {
|
||||
debug!("Validator::gather_conflicts");
|
||||
for name in matcher.arg_names() {
|
||||
debug!("Validator::gather_conflicts:iter:{:?}", name);
|
||||
debug!("Validator::gather_conflicts:iter: id={:?}", name);
|
||||
// if arg is "present" only because it got default value
|
||||
// it doesn't conflict with anything
|
||||
//
|
||||
|
@ -285,6 +285,7 @@ impl<'b, 'c, 'z> Validator<'b, 'c, 'z> {
|
|||
.get(name)
|
||||
.map_or(false, |a| a.ty == ValueType::DefaultValue)
|
||||
{
|
||||
debug!("Validator::gather_conflicts:iter: This is default value, skipping.",);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@ impl BufferWriter {
|
|||
|
||||
pub(crate) fn print(&self, buf: &Buffer) -> Result<()> {
|
||||
if self.use_stderr {
|
||||
stderr().lock().write(buf)?;
|
||||
stderr().lock().write_all(buf)?;
|
||||
} else {
|
||||
stdout().lock().write(buf)?;
|
||||
stdout().lock().write_all(buf)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue