diff options
author | Timothy DeHerrera | 2021-07-15 10:44:40 -0600 |
---|---|---|
committer | Timothy DeHerrera | 2021-07-29 18:17:53 -0600 |
commit | 8a27483dce6490eae77b5064a632a91b68c2d10c (patch) | |
tree | c49e5fbcdb7f207451b0bfefa903e9b8997a88f2 /src/cli.rs | |
parent | 3b6e84d3e274606432876b97b586d06771a3216f (diff) |
optionally take args as input
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -6,7 +6,7 @@ use std::collections::HashMap; use std::io::{stdin, stdout, Write}; -use clap::Clap; +use clap::{Clap, ArgMatches, FromArgMatches}; use crate as deploy; @@ -607,8 +607,11 @@ pub enum RunError { RunDeploy(#[from] RunDeployError), } -pub async fn run() -> Result<(), RunError> { - let opts: Opts = Opts::parse(); +pub async fn run(args: Option<&ArgMatches>) -> Result<(), RunError> { + let opts = match args { + Some(o) => <Opts as FromArgMatches>::from_arg_matches(o), + None => Opts::parse(), + }; deploy::init_logger( opts.debug_logs, |