pub async fn tag(
        &self,
        annotations: Vec<Annotation>,
        delete: bool,
        tags: Option<Vec<String>>,
    ) -> color_eyre::Result<()> {
        if annotations.is_empty() {
            println!("No matching annotations");
            return Ok(());
        }
        let tags = match tags {
            Some(tags) => tags,
            None => {
                if delete {
                    self.search_tags(&annotations, false)?
                } else {
                    self.search_tags(&annotations, true)?
                }
            }
        };
        if tags.is_empty() {
            println!("No tags selected");
            return Ok(());
        }

        if delete {
            self.delete_tags(annotations, tags).await?;
        } else {
            self.add_tags(annotations, tags).await?;
        }
        Ok(())
    }
/// Tag a filtered set of annotations with given tags
Tag a filtered set of annotations with given tags
Tag a filtered set of annotations with given tags
pub async fn tag(
        &self,
        annotations: Vec<Annotation>,
        delete: bool,
        tags: Option<Vec<String>>,
    ) -> color_eyre::Result<()> {
        if annotations.is_empty() {
            println!("No matching annotations");
            return Ok(());
        }
        let tags = match tags {
            Some(tags) => tags,
            None => {
                if delete {
                    self.search_tags(&annotations, false)?
                } else {
                    self.search_tags(&annotations, true)?
                }
            }
        };
        if tags.is_empty() {
            println!("No tags selected");
            return Ok(());
        }
        if delete {
            self.delete_tags(annotations, tags).await?;
        } else {
            self.add_tags(annotations, tags).await?;
        }
        Ok(())
    }
pub async fn tag ( & self , annotations : Vec < Annotation > , delete : bool , tags : Option < Vec < String > > , ) -> color_eyre :: Result < ( ) > { if annotations . is_empty ( ) { println ! ( " " ) ; return Ok ( ( ) ) ; } let tags = match tags { Some ( tags ) => tags , None => { if delete { self . search_tags ( & annotations , false ) ? } else { self . search_tags ( & annotations , true ) ? } } } ; if tags . is_empty ( ) { println ! ( " " ) ; return Ok ( ( ) ) ; } if delete { self . delete_tags ( annotations , tags ) . await ? ; } else { self . add_tags ( annotations , tags ) . await ? ; } Ok ( ( ) ) }
Tag a filtered set of annotations with given tags
Tag a filtered set of annotations with given tags
&self
annotations
Vec<Annotation>
delete
bool
tags
Option<Vec<String>>
&self
annotations
Vec<Annotation>
delete
bool
tags
Option<Vec<String>>