pub async fn run(&mut self, cli: GooseberryCLI) -> color_eyre::Result<()> {
        match cli.cmd {
            GooseberrySubcommand::Sync => self.sync().await,
            GooseberrySubcommand::Search { filters, fuzzy } => {
                let annotations: Vec<Annotation> = self.filter_annotations(filters, None).await?;
                self.search(annotations, fuzzy).await
            }
            GooseberrySubcommand::Tag {
                filters,
                delete,
                tag,
            } => {
                let annotations: Vec<Annotation> = self.filter_annotations(filters, None).await?;
                let tags = if tag.is_empty() { None } else { Some(tag) };
                self.tag(annotations, delete, tags).await
            }
            GooseberrySubcommand::Delete { filters, force } => {
                let annotations = self.filter_annotations(filters, None).await?;
                self.delete(annotations, force).await
            }
            GooseberrySubcommand::View { filters, id } => self.view(filters, id).await,
            GooseberrySubcommand::Move {
                group_id,
                filters,
                search,
                fuzzy,
            } => self.sync_group(group_id, filters, search, fuzzy).await,
            GooseberrySubcommand::Make {
                filters,
                clear,
                force,
                no_index,
            } => {
                self.make(
                    self.filter_annotations_make(filters).await?,
                    clear,
                    force,
                    true,
                    !no_index,
                )
                .await
            }
            GooseberrySubcommand::Index { filters } => {
                self.make(
                    self.filter_annotations_make(filters).await?,
                    false,
                    false,
                    false,
                    true,
                )
                .await
            }
            GooseberrySubcommand::Clear { force } => self.clear(force),
            GooseberrySubcommand::Uri { filters, ids } => {
                let annotations: Vec<Annotation> = self.filter_annotations(filters, None).await?;
                self.uri(annotations, ids)
            }
            _ => Ok(()), // Already handled
        }
    }
/// Run knowledge-base related functions
Run knowledge-base related functions
Run knowledge - base related functions
pub async fn run(&mut self, cli: GooseberryCLI) -> color_eyre::Result<()> {
        match cli.cmd {
            GooseberrySubcommand::Sync => self.sync().await,
            GooseberrySubcommand::Search { filters, fuzzy } => {
                let annotations: Vec<Annotation> = self.filter_annotations(filters, None).await?;
                self.search(annotations, fuzzy).await
            }
            GooseberrySubcommand::Tag {
                filters,
                delete,
                tag,
            } => {
                let annotations: Vec<Annotation> = self.filter_annotations(filters, None).await?;
                let tags = if tag.is_empty() { None } else { Some(tag) };
                self.tag(annotations, delete, tags).await
            }
            GooseberrySubcommand::Delete { filters, force } => {
                let annotations = self.filter_annotations(filters, None).await?;
                self.delete(annotations, force).await
            }
            GooseberrySubcommand::View { filters, id } => self.view(filters, id).await,
            GooseberrySubcommand::Move {
                group_id,
                filters,
                search,
                fuzzy,
            } => self.sync_group(group_id, filters, search, fuzzy).await,
            GooseberrySubcommand::Make {
                filters,
                clear,
                force,
                no_index,
            } => {
                self.make(
                    self.filter_annotations_make(filters).await?,
                    clear,
                    force,
                    true,
                    !no_index,
                )
                .await
            }
            GooseberrySubcommand::Index { filters } => {
                self.make(
                    self.filter_annotations_make(filters).await?,
                    false,
                    false,
                    false,
                    true,
                )
                .await
            }
            GooseberrySubcommand::Clear { force } => self.clear(force),
            GooseberrySubcommand::Uri { filters, ids } => {
                let annotations: Vec<Annotation> = self.filter_annotations(filters, None).await?;
                self.uri(annotations, ids)
            }
            _ => Ok(()), // Already handled
        }
    }
pub async fn run ( & mut self , cli : GooseberryCLI ) -> color_eyre :: Result < ( ) > { match cli . cmd { GooseberrySubcommand :: Sync => self . sync ( ) . await , GooseberrySubcommand :: Search { filters , fuzzy } => { let annotations : Vec < Annotation > = self . filter_annotations ( filters , None ) . await ? ; self . search ( annotations , fuzzy ) . await } GooseberrySubcommand :: Tag { filters , delete , tag , } => { let annotations : Vec < Annotation > = self . filter_annotations ( filters , None ) . await ? ; let tags = if tag . is_empty ( ) { None } else { Some ( tag ) } ; self . tag ( annotations , delete , tags ) . await } GooseberrySubcommand :: Delete { filters , force } => { let annotations = self . filter_annotations ( filters , None ) . await ? ; self . delete ( annotations , force ) . await } GooseberrySubcommand :: View { filters , id } => self . view ( filters , id ) . await , GooseberrySubcommand :: Move { group_id , filters , search , fuzzy , } => self . sync_group ( group_id , filters , search , fuzzy ) . await , GooseberrySubcommand :: Make { filters , clear , force , no_index , } => { self . make ( self . filter_annotations_make ( filters ) . await ? , clear , force , true , ! no_index , ) . await } GooseberrySubcommand :: Index { filters } => { self . make ( self . filter_annotations_make ( filters ) . await ? , false , false , false , true , ) . await } GooseberrySubcommand :: Clear { force } => self . clear ( force ) , GooseberrySubcommand :: Uri { filters , ids } => { let annotations : Vec < Annotation > = self . filter_annotations ( filters , None ) . await ? ; self . uri ( annotations , ids ) } _ => Ok ( ( ) ) , // Already handled } }
Run knowledge-base related functions
Run knowledge - base related functions
&mut self
cli
GooseberryCLI
&mut self
cli
GooseberryCLI