Ryan McGuire
c78c41f567
All checks were successful
Build and Publish / release (push) Successful in 1m10s
28 lines
698 B
Go
28 lines
698 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
var projectListCmd = &cobra.Command{
|
|
Use: "list",
|
|
Short: "List Git Projects",
|
|
Aliases: []string{"ls", "l"},
|
|
Long: projListCmdLong,
|
|
Run: projectListCmdRun,
|
|
}
|
|
|
|
func projectListCmdRun(cmd *cobra.Command, args []string) {
|
|
remotes := viper.GetStringSlice(FlagRemote)
|
|
fmt.Println(projectCache.DumpString(viper.GetBool(ViperProjectListAll), searchStringFromArgs(args), remotes...))
|
|
}
|
|
|
|
func init() {
|
|
projectCmd.AddCommand(projectListCmd)
|
|
projectListCmd.PersistentFlags().Bool(FlagAll, false, "List all, not just cloned locally")
|
|
viper.BindPFlag(ViperProjectListAll, projectListCmd.Flag(FlagAll))
|
|
}
|