-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
diffedit.go
29 lines (24 loc) · 1.07 KB
/
diffedit.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj"
"github.com/spf13/cobra"
)
var diffeditCmd = &cobra.Command{
Use: "diffedit",
Short: "Touch up the content changes in a revision with a diff editor",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(diffeditCmd).Standalone()
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")
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()),
})
}