reactive_graph/client/instances/flows/args/
label.rs

1use crate::client::error::CommandError;
2use crate::client::error::CommandError::NotFound;
3use clap::Args;
4
5/// CLI argument which identifies a reactive instance by its label.
6#[derive(Args, Debug, Clone)]
7pub(crate) struct LabelArgs {
8    /// The label of the reactive instance.
9    pub label: String,
10}
11
12impl LabelArgs {
13    pub fn not_found(&self) -> CommandError {
14        NotFound(format!("The instance with the label {} was not found", &self.label))
15    }
16}
17
18impl From<LabelArgs> for String {
19    fn from(label: LabelArgs) -> Self {
20        label.label
21    }
22}