diff --git a/completers/jj_completer/cmd/diffedit.go b/completers/jj_completer/cmd/diffedit.go index d7a16ce484..8929365d43 100644 --- a/completers/jj_completer/cmd/diffedit.go +++ b/completers/jj_completer/cmd/diffedit.go @@ -2,6 +2,7 @@ package cmd import ( "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/jj" "github.com/spf13/cobra" ) @@ -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()), + }) }