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,4 +1,4 @@
package cmd
package cache
import (
"github.com/spf13/cobra"
@@ -21,11 +21,10 @@ var clearCmd = &cobra.Command{
func clearCache(cmd *cobra.Command, args []string) {
slog.Debug("Preparing to clear local cache")
projectCache.Clear(conf.Cache.Clear.ClearAliases)
utils.Cache().Clear(utils.Config().Cache.Clear.ClearAliases)
}
func init() {
cacheCmd.AddCommand(clearCmd)
clearCmd.Flags().Bool("clearAliases", false, "Will also clear aliases from the cache, use with caution")
viper.BindPFlag("cache.clear.clearAliases", clearCmd.LocalFlags().Lookup("clearAliases"))
}