Package subcommand code
This commit is contained in:
14
cmd/cache/cache_load.go
vendored
14
cmd/cache/cache_load.go
vendored
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user