cli/commands/
command_input.rs1#[derive(Clone, Debug, PartialEq, Eq)]
5pub enum InputValue {
6 Bool(bool),
7 String(String),
8 StringList(Vec<String>),
9}
10
11#[derive(Clone, Debug, PartialEq, Eq)]
13pub struct InputOptions {
14 pub passed_as_input: bool,
15}
16
17#[derive(Clone, Debug, PartialEq, Eq)]
19pub struct Input {
20 pub name: String,
21 pub value: Option<InputValue>,
22 pub options: Option<InputOptions>,
23}
24
25impl Input {
26 pub fn new(name: impl Into<String>, value: Option<InputValue>) -> Self {
27 Self {
28 name: name.into(),
29 value,
30 options: None,
31 }
32 }
33
34 pub fn with_options(
35 name: impl Into<String>,
36 value: Option<InputValue>,
37 options: InputOptions,
38 ) -> Self {
39 Self {
40 name: name.into(),
41 value,
42 options: Some(options),
43 }
44 }
45}