git-project-manager/cmd/project_list.go

27 lines
606 B
Go
Raw Normal View History

2023-12-10 04:19:19 +00:00
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var projectListCmd = &cobra.Command{
Use: "list",
Short: "List GitLab Projects",
Aliases: []string{"ls", "show"},
Long: projListCmdLong,
Run: projectListCmdRun,
}
func projectListCmdRun(cmd *cobra.Command, args []string) {
fmt.Println(cache.DumpString(viper.GetBool("project.list.all")))
}
func init() {
projectCmd.AddCommand(projectListCmd)
projectListCmd.PersistentFlags().Bool("all", false, "List all, not just cloned locally")
viper.BindPFlag("project.list.all", projectListCmd.Flag("all"))
}