Skip to content

Commit

Permalink
fix: check --cmd-binary only if cmd plugin is used
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Dec 20, 2023
1 parent 50f2854 commit e25d6e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/plugins/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ impl Plugin for Command {

fn setup(&mut self, opts: &Options) -> Result<(), Error> {
self.opts = opts.cmd.clone();
Ok(())
if self.opts.cmd_binary.is_empty() {
Err("please provide --cmd-binary and optionally --cmd-args".to_owned())
} else {
Ok(())
}
}

async fn attempt(&self, creds: &Credentials, timeout: Duration) -> Result<Option<Loot>, Error> {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/cmd/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
#[derive(Parser, Debug, Serialize, Deserialize, Clone, Default)]
#[group(skip)]
pub(crate) struct Options {
#[clap(long)]
#[clap(long, default_value = "")]
/// Command binary path.
pub cmd_binary: String,

Expand Down

0 comments on commit e25d6e9

Please sign in to comment.