-
Notifications
You must be signed in to change notification settings - Fork 270
/
Copy pathcloud.rs
43 lines (39 loc) · 1.17 KB
/
cloud.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use crate::commands::external::execute_external_subcommand;
use anyhow::Result;
use clap::Args;
#[derive(Debug, Args, PartialEq)]
#[clap(
about = "Package and upload an application to the Fermyon Cloud.",
allow_hyphen_values = true,
disable_help_flag = true
)]
pub struct DeployCommand {
/// All args to be passed through to the plugin
#[clap(hide = true)]
args: Vec<String>,
}
#[derive(Debug, Args, PartialEq)]
#[clap(
about = "Log into the Fermyon Cloud.",
allow_hyphen_values = true,
disable_help_flag = true
)]
pub struct LoginCommand {
/// All args to be passed through to the plugin
#[clap(hide = true)]
args: Vec<String>,
}
impl DeployCommand {
pub async fn run(self, app: clap::App<'_>) -> Result<()> {
let mut cmd = vec!["cloud".to_string(), "deploy".to_string()];
cmd.append(&mut self.args.clone());
execute_external_subcommand(cmd, app).await
}
}
impl LoginCommand {
pub async fn run(self, app: clap::App<'_>) -> Result<()> {
let mut cmd = vec!["cloud".to_string(), "login".to_string()];
cmd.append(&mut self.args.clone());
execute_external_subcommand(cmd, app).await
}
}