mirror of
https://github.com/arampoire/nut-rs.git
synced 2025-11-30 16:20:25 -05:00
Return Vec of len 1 when params are not given in Command::args for run command
This commit is contained in:
parent
d92870910b
commit
7f7f8db807
1 changed files with 3 additions and 1 deletions
|
|
@ -50,7 +50,9 @@ impl<'a> Command<'a> {
|
||||||
Self::SetPassword(password) => vec![password],
|
Self::SetPassword(password) => vec![password],
|
||||||
Self::List(query) => query.to_vec(),
|
Self::List(query) => query.to_vec(),
|
||||||
#[cfg(feature = "write")]
|
#[cfg(feature = "write")]
|
||||||
Self::Run(cmd, param) => vec![cmd, param.unwrap_or("")],
|
Self::Run(cmd, param) => param
|
||||||
|
.map(|param| vec![cmd, param])
|
||||||
|
.unwrap_or_else(|| vec![cmd]),
|
||||||
_ => Vec::new(),
|
_ => Vec::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue