|
1 | | -use crate::types::BitteProvider; |
2 | | -use clap::{ArgSettings, Parser}; |
| 1 | +use crate::cli::opts::{Globals, Nomad}; |
| 2 | +use clap::Parser; |
3 | 3 | use clap_complete::Shell; |
4 | 4 | use deploy::data as deployData; |
5 | 5 | use deploy::settings as deploySettings; |
6 | | -use uuid::Uuid; |
7 | 6 |
|
8 | 7 | #[derive(Parser)] |
9 | 8 | pub enum SubCommands { |
@@ -57,50 +56,6 @@ pub struct Completions { |
57 | 56 | shell: Shell, |
58 | 57 | } |
59 | 58 |
|
60 | | -#[derive(Parser, Default)] |
61 | | -struct Globals { |
62 | | - #[clap(arg_enum, long, env = "BITTE_PROVIDER", ignore_case = true, value_parser = clap::value_parser!(BitteProvider))] |
63 | | - /// The cluster infrastructure provider |
64 | | - provider: BitteProvider, |
65 | | - #[clap(long, env = "BITTE_DOMAIN", value_name = "NAME")] |
66 | | - /// The public domain of the cluster |
67 | | - domain: String, |
68 | | - #[clap(long = "cluster", env = "BITTE_CLUSTER", value_name = "TITLE")] |
69 | | - /// The unique name of the cluster |
70 | | - name: String, |
71 | | - #[clap( |
72 | | - long, |
73 | | - env = "AWS_DEFAULT_REGION", |
74 | | - value_name = "REGION", |
75 | | - required_if_eq("provider", "AWS") |
76 | | - )] |
77 | | - /// The default AWS region |
78 | | - aws_region: Option<String>, |
79 | | - #[clap( |
80 | | - long, |
81 | | - env = "AWS_ASG_REGIONS", |
82 | | - value_name = "REGIONS", |
83 | | - required_if_eq("provider", "AWS"), |
84 | | - value_delimiter(':'), |
85 | | - require_delimiter = true |
86 | | - )] |
87 | | - /// Regions containing Nomad clients |
88 | | - aws_asg_regions: Option<Vec<String>>, |
89 | | -} |
90 | | - |
91 | | -#[derive(Parser, Default)] |
92 | | -struct Nomad { |
93 | | - #[clap( |
94 | | - long, |
95 | | - value_name = "TOKEN", |
96 | | - env = "NOMAD_TOKEN", |
97 | | - value_parser = clap::value_parser!(Uuid), |
98 | | - setting = ArgSettings::HideEnvValues |
99 | | - )] |
100 | | - /// The Nomad token used to query node information |
101 | | - nomad: Option<Uuid>, |
102 | | -} |
103 | | - |
104 | 59 | #[derive(Parser)] |
105 | 60 | /// SSH to instances |
106 | 61 | pub struct Ssh { |
|
0 commit comments