added interactive mode (#44)
Co-authored-by: kjuulh <contact@kjuulh.io> Reviewed-on: https://git.front.kjuulh.io/kjuulh/octopush/pulls/44
This commit is contained in:
@@ -66,6 +66,15 @@ pub fn execute_cmd() -> Command {
|
||||
.default_value("true")
|
||||
.required(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("interactive")
|
||||
.long("interactive")
|
||||
.short('i')
|
||||
.action(ArgAction::Set)
|
||||
.env("OCTOPUSH_INTERACTIVE")
|
||||
.default_value("false")
|
||||
.required(false),
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
|
||||
@@ -84,6 +93,11 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
|
||||
.ok_or(eyre::anyhow!("--dry-run is required"))?
|
||||
.parse()?;
|
||||
|
||||
let interactive: bool = args
|
||||
.get_one::<String>("interactive")
|
||||
.ok_or(eyre::anyhow!("--interactive is required"))?
|
||||
.parse()?;
|
||||
|
||||
if dryrun {
|
||||
tracing::info!("running in dry-run mode");
|
||||
}
|
||||
@@ -123,21 +137,21 @@ pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> {
|
||||
if let Some(git) = &select.git {
|
||||
service_register
|
||||
.git_selector
|
||||
.run(git, &action_path, &action, dryrun)
|
||||
.run(git, &action_path, &action, dryrun, interactive)
|
||||
.await?;
|
||||
}
|
||||
|
||||
if let Some(gitea) = &select.gitea {
|
||||
service_register
|
||||
.gitea_selector
|
||||
.run(gitea, &action_path, &action, dryrun)
|
||||
.run(gitea, &action_path, &action, dryrun, interactive)
|
||||
.await?;
|
||||
}
|
||||
|
||||
if let Some(github) = &select.github {
|
||||
service_register
|
||||
.github_selector
|
||||
.run(github, &action_path, &action, dryrun)
|
||||
.run(github, &action_path, &action, dryrun, interactive)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user