rhg: use default configitem in `cat`
Now that we've declared the items, we can get rid of the manual fallback.
--- a/rust/rhg/src/commands/cat.rs Thu Jul 06 11:47:41 2023 +0200
+++ b/rust/rhg/src/commands/cat.rs Thu Jul 06 12:17:20 2023 +0200
@@ -32,9 +32,8 @@
#[logging_timer::time("trace")]
pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
- let cat_enabled_default = true;
- let cat_enabled = invocation.config.get_option(b"rhg", b"cat")?;
- if !cat_enabled.unwrap_or(cat_enabled_default) {
+ let cat_enabled = invocation.config.get_bool(b"rhg", b"cat")?;
+ if !cat_enabled {
return Err(CommandError::unsupported(
"cat is disabled in rhg (enable it with 'rhg.cat = true' \
or enable fallback with 'rhg.on-unsupported = fallback')",