Skip to content

Commit

Permalink
git: interpret-trailers
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Oct 29, 2023
1 parent 427d0b8 commit b08c89e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 29 deletions.
39 changes: 39 additions & 0 deletions completers/git_completer/cmd/interpretTrailers.go
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 completers/git_completer/cmd/interpret_trailers_generated.go

This file was deleted.

0 comments on commit b08c89e

Please sign in to comment.