From c6c6e63ba4ba6e1ba7e4b0a511f7d8df9c79b372 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 7 Nov 2026 15:02:31 +0100 Subject: feat(yt/cmds/config): Implement showing the default config --- crates/yt/src/commands/config/implm.rs | 5 ++++- crates/yt/src/commands/config/mod.rs | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/yt/src/commands/config/implm.rs b/crates/yt/src/commands/config/implm.rs index 00c28a9..ecc8853 100644 --- a/crates/yt/src/commands/config/implm.rs +++ b/crates/yt/src/commands/config/implm.rs @@ -14,7 +14,10 @@ use anyhow::Result; impl ConfigCommand { pub(in crate::commands) fn implm(self, app: &App) -> Result<()> { - let config_str = toml::to_string(&app.config)?; + let config_str = match self { + ConfigCommand::Show {} => toml::to_string(&app.config)?, + ConfigCommand::Default {} => crate::config::def::Config::config_doc().to_string(), + }; print!("{config_str}"); diff --git a/crates/yt/src/commands/config/mod.rs b/crates/yt/src/commands/config/mod.rs index 503b4f7..a125903 100644 --- a/crates/yt/src/commands/config/mod.rs +++ b/crates/yt/src/commands/config/mod.rs @@ -8,9 +8,15 @@ // You should have received a copy of the License along with this program. // If not, see . -use clap::Parser; +use clap::Subcommand; mod implm; -#[derive(Parser, Debug)] -pub(super) struct ConfigCommand {} +#[derive(Subcommand, Debug)] +pub(super) enum ConfigCommand { + /// Show the current config, with all command-line overrides applied. + Show {}, + + /// Print the default configuration with documentation comments. + Default {}, +} -- cgit v1.3.1