Skip to content

Commit

Permalink
added git clean
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 23, 2020
1 parent 1a6ef32 commit db6c134
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var cleanCmd = &cobra.Command{
Use: "clean",
Short: "Remove untracked files from the working tree",
Run: func(cmd *cobra.Command, args []string) {
},
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
cleanCmd.Flags().BoolP("d", "d", false, "remove whole directories")
cleanCmd.Flags().BoolP("exclude", "e", false, "<pattern> add <pattern> to ignore rules")
carapace.Gen(cleanCmd).Standalone()

cleanCmd.Flags().BoolS("x", "x", false, "remove ignored files, too")
cleanCmd.Flags().BoolS("X", "X", false, "remove only ignored files")
cleanCmd.Flags().BoolS("d", "d", false, "remove whole directories")
cleanCmd.Flags().BoolP("dry-run", "n", false, "dry run")
cleanCmd.Flags().StringP("exclude", "e", "", "add <pattern> to ignore rules")
cleanCmd.Flags().BoolP("force", "f", false, "force")
cleanCmd.Flags().BoolP("interactive", "i", false, "interactive cleaning")
cleanCmd.Flags().BoolP("dry-run", "n", false, "dry run")
cleanCmd.Flags().BoolP("quiet", "q", false, "do not print names of files removed")
cleanCmd.Flags().BoolP("x", "x", false, "remove ignored files, too")
cleanCmd.Flags().BoolP("X", "X", false, "remove only ignored files")
rootCmd.AddCommand(cleanCmd)

carapace.Gen(cleanCmd).PositionalAnyCompletion(carapace.ActionFiles(""))
}

0 comments on commit db6c134

Please sign in to comment.