Package subcommand code

This commit is contained in:
2024-12-30 15:50:31 -05:00
parent 96378d047e
commit b9d7d5a4f2
51 changed files with 357 additions and 295 deletions

View File

@@ -1,8 +1,10 @@
package cmd
package cache
import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
)
var loadCmd = &cobra.Command{
@@ -17,15 +19,13 @@ wants to find a new project.`,
}
func loadCache(cmd *cobra.Command, args []string) {
remotes := viper.GetStringSlice(FlagRemote)
projectCache.Refresh(remotes...)
remotes := viper.GetStringSlice(util.FlagRemote)
utils.Cache().Refresh(remotes...)
}
func init() {
cacheCmd.AddCommand(loadCmd)
loadCmd.PersistentFlags().Bool(FlagOwnerOnly, true,
loadCmd.PersistentFlags().Bool(util.FlagOwnerOnly, true,
"Only load projects that you are owner of")
viper.BindPFlag(ViperCacheLoadOwnerOnly, loadCmd.Flag(FlagOwnerOnly))
viper.BindPFlag(util.ViperCacheLoadOwnerOnly, loadCmd.Flag(util.FlagOwnerOnly))
}