Skip to content

Commit

Permalink
git: commit-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Aug 15, 2024
1 parent 5b4c1a6 commit a0a28eb
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 22 deletions.
38 changes: 38 additions & 0 deletions completers/git_completer/cmd/commitTree.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/os"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git"
"github.com/spf13/cobra"
)

var commitTreeCmd = &cobra.Command{
Use: "commit-tree",
Short: "Create a new commit object",
Run: func(cmd *cobra.Command, args []string) {},
GroupID: groups[group_low_level_manipulator].ID,
}

func init() {
carapace.Gen(commitTreeCmd).Standalone()

commitTreeCmd.Flags().StringS("F", "F", "", "read commit log message from file")
commitTreeCmd.Flags().StringP("gpg-sign", "S", "", "GPG sign commit")
commitTreeCmd.Flags().StringS("m", "m", "", "commit message")
commitTreeCmd.Flags().Bool("no-gpg-sign", false, "do not GPG sign commit")
commitTreeCmd.Flags().StringSliceS("p", "p", nil, "id of a parent commit object")
rootCmd.AddCommand(commitTreeCmd)

commitTreeCmd.Flag("gpg-sign").NoOptDefVal = " "

carapace.Gen(commitTreeCmd).FlagCompletion(carapace.ActionMap{
"F": carapace.ActionFiles(),
"gpg-sign": os.ActionGpgKeyIds(),
"p": git.ActionRefs(git.RefOption{}.Default()), // TODO what are valid parents?
})

carapace.Gen(commitTreeCmd).PositionalCompletion(
git.ActionRefs(git.RefOption{}.Default()), // TODO what's a tree object?
)
}
22 changes: 0 additions & 22 deletions completers/git_completer/cmd/commit_tree_generated.go

This file was deleted.

0 comments on commit a0a28eb

Please sign in to comment.