-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
gc.go
27 lines (22 loc) · 882 Bytes
/
gc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var gcCmd = &cobra.Command{
Use: "gc",
Short: "Cleanup unnecessary files and optimize the local repository",
Run: func(cmd *cobra.Command, args []string) {},
GroupID: groups[group_main].ID,
}
func init() {
carapace.Gen(gcCmd).Standalone()
gcCmd.Flags().Bool("aggressive", false, "be more thorough (increased runtime)")
gcCmd.Flags().Bool("auto", false, "enable auto-gc mode")
gcCmd.Flags().Bool("force", false, "force running gc even if there may be another gc running")
gcCmd.Flags().Bool("keep-largest-pack", false, "repack all other packs except the largest pack")
gcCmd.Flags().String("prune", "", "prune unreferenced objects")
gcCmd.Flags().BoolP("quiet", "q", false, "suppress progress reporting")
rootCmd.AddCommand(gcCmd)
gcCmd.Flag("prune").NoOptDefVal = " "
}