Skip to content

Commit

Permalink
feat: 拆分 cmd.go 中的子命令到不同的文件 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhaolei authored May 15, 2024
1 parent 8c727c9 commit b7b04e3
Show file tree
Hide file tree
Showing 12 changed files with 359 additions and 302 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ cmd/vmr/vmr
cmd/vmr/vmr.exe
cmd/vmr/vm
cmd/vmr/vm.exe
manager
vmr
vm

bin/

build_win.sh
.DS_Store
Expand Down
296 changes: 0 additions & 296 deletions cmd/cmd.go

This file was deleted.

24 changes: 24 additions & 0 deletions cmd/vmr/internal/cli/clear_cache.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cli

import (
"github.com/gvcgo/version-manager/pkgs/register"
"github.com/spf13/cobra"
)

var clearCacheCmd = &cobra.Command{
Use: "clear-cache",
Aliases: []string{"c", "cc"},
GroupID: GroupID,
Short: "Clears cached zip files for an app.",
Long: "Example: vmr c <sdk-name>",
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
_ = cmd.Help()
return
}
appName := args[0]
if ins, ok := register.VersionKeeper[appName]; ok {
register.RunClearCache(ins)
}
},
}
Loading

0 comments on commit b7b04e3

Please sign in to comment.