diff options
author | Thomas Otto <th1000s@posteo.net> | 2021-10-13 23:58:09 +0200 |
---|---|---|
committer | Thomas Otto <th1000s@posteo.net> | 2021-10-16 14:07:30 +0200 |
commit | f467f4cdd082ae5b2e032f1f573f488c03de6f5c (patch) | |
tree | d9af79b845dc04e3ff576a51377a81abacce397b | |
parent | 636b56729be21a17a5520988f0d23f5d26e9a277 (diff) |
StructOpt without Default
This does not use the values provided by default_value, so
validation will fail.
-rw-r--r-- | src/cli.rs | 3 | ||||
-rw-r--r-- | src/subcommands/show_syntax_themes.rs | 2 |
2 files changed, 3 insertions, 2 deletions
@@ -13,7 +13,8 @@ use crate::bat_utils::output::PagingMode; use crate::git_config::{GitConfig, GitConfigEntry}; use crate::options; -#[derive(StructOpt, Default)] +// No Default trait as this ignores `default_value = ..` +#[derive(StructOpt)] #[structopt( name = "delta", about = "A viewer for git and diff output", diff --git a/src/subcommands/show_syntax_themes.rs b/src/subcommands/show_syntax_themes.rs index cd489bb1..d7ecea76 100644 --- a/src/subcommands/show_syntax_themes.rs +++ b/src/subcommands/show_syntax_themes.rs @@ -15,7 +15,7 @@ pub fn show_syntax_themes() -> std::io::Result<()> { let mut output_type = OutputType::from_mode( PagingMode::QuitIfOneScreen, None, - &config::Config::from(cli::Opt::default()), + &config::Config::from(cli::Opt::from_args()), ) .unwrap(); let mut writer = output_type.handle().unwrap(); |