Skip to content

Commit 71edd4d

Browse files
committed
change external interface to take parsed Opts
1 parent d630e13 commit 71edd4d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cli.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ use tokio::process::Command;
2323
pub struct Opts {
2424
/// The flake to deploy
2525
#[clap(group = "deploy")]
26-
target: Option<String>,
26+
pub target: Option<String>,
2727

2828
/// A list of flakes to deploy alternatively
2929
#[clap(long, group = "deploy")]
30-
targets: Option<Vec<String>>,
30+
pub targets: Option<Vec<String>>,
3131

3232
/// Override hostname used for the node
3333
#[clap(long)]
34-
hostname: Option<String>,
34+
pub hostname: Option<String>,
3535

3636
#[clap(flatten)]
37-
flags: data::Flags,
37+
pub flags: data::Flags,
3838

3939
#[clap(flatten)]
40-
generic_settings: settings::GenericSettings,
40+
pub generic_settings: settings::GenericSettings,
4141
}
4242

4343
/// Returns if the available Nix installation supports flakes
@@ -271,9 +271,9 @@ pub enum RunError {
271271
RunDeploy(#[from] RunDeployError),
272272
}
273273

274-
pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> {
274+
pub async fn run(args: Option<Opts>) -> Result<(), RunError> {
275275
let opts = match args {
276-
Some(o) => <Opts as FromArgMatches>::from_arg_matches(o).unwrap_or_default(),
276+
Some(o) => o,
277277
None => Opts::parse(),
278278
};
279279

0 commit comments

Comments
 (0)