##// END OF EJS Templates
rhg: Return an error code for `rhg config Section.idontexist`...
Simon Sapin -
r47481:b1e6265e default
parent child Browse files
Show More
@@ -29,8 +29,10 b' pub fn run(invocation: &crate::CliInvoca'
29 .split_2(b'.')
29 .split_2(b'.')
30 .ok_or_else(|| HgError::unsupported("hg config <section>"))?;
30 .ok_or_else(|| HgError::unsupported("hg config <section>"))?;
31
31
32 let value = invocation.config.get(section, name).unwrap_or(b"");
32 if let Some(value) = invocation.config.get(section, name) {
33
33 invocation.ui.write_stdout(&format_bytes!(b"{}\n", value))?;
34 invocation.ui.write_stdout(&format_bytes!(b"{}\n", value))?;
34 Ok(())
35 Ok(())
35 } else {
36 Err(CommandError::Unsuccessful)
37 }
36 }
38 }
General Comments 0
You need to be logged in to leave comments. Login now