MCPcopy Create free account
hub / github.com/celer-pkg/celer / Command

Method Command

cmds/cmd_clean.go:29–63  ·  view source on GitHub ↗
(celer *configs.Celer)

Source from the content-addressed store, hash-verified

27}
28
29func (c *cleanCmd) Command(celer *configs.Celer) *cobra.Command {
30 c.celer = celer
31 command := &cobra.Command{
32 Use: "clean",
33 Short: "Remove build cache and clean source repository.",
34 Long: `Remove build cache and clean source repository.
35
36This command removes build artifacts and caches for specified packages or
37projects. It can optionally clean dependencies recursively and handle both
38release and development builds.
39
40Examples:
41 celer clean x264@stable # Clean specific package
42 celer clean my-project # Clean project
43 celer clean x264@stable --dev # Clean dev build cache
44 celer clean automake@1.18 --recursive # Clean with dependencies
45 celer clean --all # Clean all packages
46 celer clean x264@stable ffmpeg@3.4.13 --recursive # Clean multiple packages`,
47 Args: c.validateArgs,
48 RunE: func(cmd *cobra.Command, args []string) error {
49 return c.execute(args)
50 },
51 ValidArgsFunction: c.completion,
52 }
53
54 // Register flags.
55 command.Flags().BoolVarP(&c.recursive, "recursive", "r", false, "clean package/project along with its depedencies.")
56 command.Flags().BoolVarP(&c.dev, "dev", "d", false, "clean package/project for dev mode.")
57 command.Flags().BoolVarP(&c.all, "all", "a", false, "clean all packages.")
58
59 // Silence cobra's error and usage output to avoid duplicate messages.
60 command.SilenceErrors = true
61 command.SilenceUsage = true
62 return command
63}
64
65func (c *cleanCmd) validateArgs(cmd *cobra.Command, args []string) error {
66 all, err := cmd.Flags().GetBool("all")

Calls 1

executeMethod · 0.95