From decd51993e2b0526fe223542ac50bbd7c694cb50 Mon Sep 17 00:00:00 2001 From: Jonas da Silva Date: Thu, 17 Oct 2024 22:00:02 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20`args`=20and=20`options`=20can?= =?UTF-8?q?=20be=20omitted=20as=20expected=20(fixes=20#34)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.rs | 2 +- src/plugin.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index f0f57f0..7168755 100644 --- a/src/config.rs +++ b/src/config.rs @@ -179,7 +179,7 @@ pub struct Plugin { /// Arguments passed to the executable. #[serde(default, flatten)] - pub args: PluginArgs, + pub args: Option, /// A filter which decides whether the plugin should be run. /// diff --git a/src/plugin.rs b/src/plugin.rs index db58c44..73f0bba 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -38,7 +38,7 @@ impl From<&config::Plugin> for ExecutablePlugin { if value.with.is_some() { args.push(value.run.clone()); }; - match &value.args { + match value.args.clone().unwrap_or_default() { config::PluginArgs::Options(options) => { args.push( serde_json::to_string(&options)