Skip to content

Commit

Permalink
feat(cmd): Add new 'list' command to list installed plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbinoGeek committed May 20, 2024
1 parent 9a460d1 commit baca59c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions cmd/flower/listCmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package main

import (
"context"
"errors"
"strconv"
"strings"

"github.com/spf13/cobra"
)

var listCmd = &cobra.Command{
Use: "list",
Aliases: []string{"ls", "l", "installed"},
Short: "List installed plugins",
Long: "List installed plugins by name, author, tags or summary",
Example: `flower list`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
var sb strings.Builder

// quote-parse using strconv
for i, arg := range args {
sb.WriteString(strconv.Quote(arg))
if i < len(args)-1 {
sb.WriteString(" ")
}
}

return listPlugins(cmd.Context(), sb.String())
},
}

func init() {
rootCmd.AddCommand(listCmd)
}

func listPlugins(ctx context.Context, query string) error {
return errors.New("not implemented")
}

0 comments on commit baca59c

Please sign in to comment.