-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1945 from rsteube/git-interprettrailers
git: interpret-trailers
- Loading branch information
Showing
2 changed files
with
39 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var interpretTrailerCmd = &cobra.Command{ | ||
Use: "interpret-trailer", | ||
Short: "Add or parse structured information in commit messages", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
GroupID: groups[group_low_level_helper].ID, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(interpretTrailerCmd).Standalone() | ||
|
||
interpretTrailerCmd.Flags().String("if-exists", "", "action if trailer already exists") | ||
interpretTrailerCmd.Flags().Bool("in-place", false, "edit files in place") | ||
interpretTrailerCmd.Flags().Bool("no-divider", false, "do not treat --- specially") | ||
interpretTrailerCmd.Flags().Bool("only-input", false, "do not apply config rules") | ||
interpretTrailerCmd.Flags().Bool("only-trailers", false, "output only the trailers") | ||
interpretTrailerCmd.Flags().Bool("parse", false, "set parsing options") | ||
interpretTrailerCmd.Flags().String("trailer", "", "trailer(s) to add") | ||
interpretTrailerCmd.Flags().Bool("trim-empty", false, "trim empty trailers") | ||
interpretTrailerCmd.Flags().Bool("unfold", false, "join whitespace-continued values") | ||
interpretTrailerCmd.Flags().String("where", "", "where to place the new trailer") | ||
rootCmd.AddCommand(interpretTrailerCmd) | ||
|
||
carapace.Gen(interpretTrailerCmd).FlagCompletion(carapace.ActionMap{ | ||
"if-exists": carapace.ActionValues("addIfDifferent", "addIfDifferentNeighbor", "add", "replace", "doNothing"), | ||
"trailer": carapace.ActionValues("doNothing", "add"), | ||
"where": carapace.ActionValues("after", "before", "end", "start"), | ||
}) | ||
|
||
carapace.Gen(interpretTrailerCmd).PositionalAnyCompletion( | ||
carapace.ActionFiles(), | ||
) | ||
} |
29 changes: 0 additions & 29 deletions
29
completers/git_completer/cmd/interpret_trailers_generated.go
This file was deleted.
Oops, something went wrong.