diff options
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/yt/src/commands/config/implm.rs | 5 | ||||
| -rw-r--r-- | 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 <https://www.gnu.org/licenses/gpl-3.0.txt>. -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 {}, +} |
