Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jj: diffedit #1999

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions completers/jj_completer/cmd/diffedit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)

Expand All @@ -14,9 +15,15 @@ var diffeditCmd = &cobra.Command{
func init() {
carapace.Gen(diffeditCmd).Standalone()

diffeditCmd.Flags().String("from", "", "Show changes from this revision. Defaults to @ if --to is specified")
diffeditCmd.Flags().String("from", "@", "Show changes from this revision. Defaults to @ if --to is specified")
diffeditCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')")
diffeditCmd.Flags().StringP("revision", "r", "", "The revision to touch up. Defaults to @ if neither --to nor --from are specified")
diffeditCmd.Flags().String("to", "", "Edit changes in this revision. Defaults to @ if --from is specified")
diffeditCmd.Flags().StringP("revision", "r", "@", "The revision to touch up. Defaults to @ if neither --to nor --from are specified")
diffeditCmd.Flags().String("to", "@", "Edit changes in this revision. Defaults to @ if --from is specified")
rootCmd.AddCommand(diffeditCmd)

carapace.Gen(diffeditCmd).FlagCompletion(carapace.ActionMap{
"from": jj.ActionRevs(jj.RevOption{}.Default()),
"revision": jj.ActionRevs(jj.RevOption{}.Default()),
"to": jj.ActionRevs(jj.RevOption{}.Default()),
})
}