-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
39 additions
and
24 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/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var updateRefCmd = &cobra.Command{ | ||
Use: "update-ref", | ||
Short: "Update the object name stored in a ref safely", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
GroupID: groups[group_low_level_manipulator].ID, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(updateRefCmd).Standalone() | ||
|
||
updateRefCmd.Flags().Bool("create-reflog", false, "create a reflog") | ||
updateRefCmd.Flags().BoolS("d", "d", false, "delete the reference") | ||
updateRefCmd.Flags().Bool("deref", false, "opposite of --no-deref") | ||
updateRefCmd.Flags().StringS("m", "m", "", "reason of the update") | ||
updateRefCmd.Flags().Bool("no-create-reflog", false, "do not create a reflog") | ||
updateRefCmd.Flags().Bool("no-deref", false, "update <refname> not the one it points to") | ||
updateRefCmd.Flags().Bool("no-stdin", false, "do not read updates from stdin") | ||
updateRefCmd.Flags().Bool("stdin", false, "read updates from stdin") | ||
updateRefCmd.Flags().BoolS("z", "z", false, "stdin has NUL-terminated arguments") | ||
rootCmd.AddCommand(updateRefCmd) | ||
|
||
carapace.Gen(updateRefCmd).PositionalCompletion( | ||
|
||
carapace.ActionCallback(func(c carapace.Context) carapace.Action { | ||
if updateRefCmd.Flag("stdin").Changed { | ||
return carapace.ActionValues() | ||
} | ||
return git.ActionRefs(git.RefOption{}.Default()) | ||
}), | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.