use crate::cli::parser::ConfigArgs;
use crate::commands::base::{Command, CommandContext};
use anyhow::Result;
use rudof_lib::TomlConfig;
use std::io::Write;
pub struct ConfigCommand {
#[allow(dead_code)]
args: ConfigArgs,
}
impl ConfigCommand {
pub fn new(args: ConfigArgs) -> Self {
Self { args }
}
}
impl Command for ConfigCommand {
fn execute(&self, ctx: &mut CommandContext) -> Result<()> {
let toml = ctx.rudof.config().execute().to_toml_string()?;
writeln!(ctx.writer, "{toml}")?;
Ok(())
}
fn name(&self) -> &'static str {
"config"
}
}