-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
26 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,44 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var replaceCmd = &cobra.Command{ | ||
Use: "replace", | ||
Short: "Create, list, delete refs to replace objects", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
GroupID: groups[group_manipulator].ID, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(replaceCmd).Standalone() | ||
|
||
replaceCmd.Flags().Bool("convert-graft-file", false, "Creates graft commits for all entries in $GIT_DIR/info/grafts and deletes that file upon success") | ||
replaceCmd.Flags().BoolP("delete", "d", false, "Delete existing replace refs for the given objects") | ||
replaceCmd.Flags().String("edit", "", "Edit an object’s content interactively") | ||
replaceCmd.Flags().BoolP("force", "f", false, "If an existing replace ref for the same object exists, it will be overwritten") | ||
replaceCmd.Flags().String("format", "", "When listing, use the specified <format>") | ||
replaceCmd.Flags().String("graft", "", "Create a graft commit") | ||
replaceCmd.Flags().StringP("list", "l", "", "List replace refs for objects that match the given pattern") | ||
replaceCmd.Flags().Bool("raw", false, "When editing, provide the raw object contents rather than pretty-printed ones") | ||
rootCmd.AddCommand(replaceCmd) | ||
|
||
replaceCmd.MarkFlagsMutuallyExclusive( | ||
"convert-graft-file", | ||
"delete", | ||
"edit", | ||
"graft", | ||
) | ||
|
||
carapace.Gen(replaceCmd).FlagCompletion(carapace.ActionMap{ | ||
"format": carapace.ActionValuesDescribed( | ||
"short", "<replaced sha1>", | ||
"medium", "<replaced sha1> → <replacement sha1>", | ||
"long", "<replaced sha1> (<replaced type>) → <replacement sha1> (<replacement type>)", | ||
), | ||
}) | ||
|
||
// TODO positional completion | ||
} |
This file was deleted.
Oops, something went wrong.