-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2424 from aftix/jj_v0.19
jj_completer: updated for jj v0.19.0
- Loading branch information
Showing
17 changed files
with
226 additions
and
5 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,33 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var branch_moveCmd = &cobra.Command{ | ||
Use: "move [OPTIONS] <--from <REVISIONS>|NAME>", | ||
Short: "Move existing branches to target revision", | ||
Aliases: []string{"s"}, | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(branch_moveCmd).Standalone() | ||
|
||
branch_moveCmd.Flags().BoolP("allow-backwards", "B", false, "Allow moving the branch backwards or sideways") | ||
branch_moveCmd.Flags().String("from", "@", "Move part of this change into the destination") | ||
branch_moveCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") | ||
branch_moveCmd.Flags().String("to", "@", "Move part of the source into this change") | ||
branchCmd.AddCommand(branch_moveCmd) | ||
|
||
carapace.Gen(branch_moveCmd).FlagCompletion(carapace.ActionMap{ | ||
"from": jj.ActionRevs(jj.RevOption{}.Default()), | ||
"to": jj.ActionRevs(jj.RevOption{}.Default()), | ||
}) | ||
|
||
carapace.Gen(branch_moveCmd).PositionalAnyCompletion( | ||
jj.ActionLocalBranches().FilterArgs(), | ||
) | ||
} |
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
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
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,19 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var fileCmd = &cobra.Command{ | ||
Use: "file", | ||
Short: "File operations", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(fileCmd).Standalone() | ||
|
||
fileCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") | ||
rootCmd.AddCommand(fileCmd) | ||
} |
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/jj" | ||
"github.com/carapace-sh/carapace/pkg/style" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var file_chmodCmd = &cobra.Command{ | ||
Use: "chmod [OPTIONS] <MODE> <PATHS>...", | ||
Short: "Sets or removes the executable bit for paths in the repo", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(file_chmodCmd).Standalone() | ||
|
||
file_chmodCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") | ||
file_chmodCmd.Flags().StringP("revision", "r", "", "The revision to update") | ||
fileCmd.AddCommand(file_chmodCmd) | ||
|
||
carapace.Gen(file_chmodCmd).FlagCompletion(carapace.ActionMap{ | ||
"revision": jj.ActionRevs(jj.RevOption{}.Default()), | ||
}) | ||
|
||
carapace.Gen(file_chmodCmd).PositionalCompletion( | ||
carapace.ActionStyledValuesDescribed( | ||
"n", "normal", style.Default, | ||
"x", "executable", style.Yellow, | ||
), | ||
) | ||
|
||
carapace.Gen(file_chmodCmd).PositionalAnyCompletion( | ||
carapace.ActionCallback(func(c carapace.Context) carapace.Action { | ||
return jj.ActionRevFiles(file_chmodCmd.Flag("revision").Value.String()) | ||
}), | ||
) | ||
} |
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,22 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var file_helpCmd = &cobra.Command{ | ||
Use: "help", | ||
Short: "Print this message or the help of the given subcommand(s)", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(file_helpCmd).Standalone() | ||
|
||
fileCmd.AddCommand(file_helpCmd) | ||
|
||
carapace.Gen(file_helpCmd).PositionalAnyCompletion( | ||
carapace.ActionCommands(utilCmd), | ||
) | ||
} |
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,31 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var file_listCmd = &cobra.Command{ | ||
Use: "files [OPTIONS] [PATHS]...", | ||
Short: "List files in a revision", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(file_listCmd).Standalone() | ||
|
||
file_listCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") | ||
file_listCmd.Flags().StringP("revision", "r", "@", "The revision to list files in") | ||
fileCmd.AddCommand(file_listCmd) | ||
|
||
carapace.Gen(file_listCmd).FlagCompletion(carapace.ActionMap{ | ||
"revision": jj.ActionRevs(jj.RevOption{}.Default()), | ||
}) | ||
|
||
carapace.Gen(file_listCmd).PositionalAnyCompletion( | ||
carapace.ActionCallback(func(c carapace.Context) carapace.Action { | ||
return jj.ActionRevFiles(file_listCmd.Flag("revision").Value.String()) | ||
}), | ||
) | ||
} |
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,32 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var file_showCmd = &cobra.Command{ | ||
Use: "show [OPTIONS] <PATH>", | ||
Short: "Print contents of a file in a revision", | ||
Aliases: []string{}, | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(file_showCmd).Standalone() | ||
|
||
file_showCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") | ||
file_showCmd.Flags().StringP("revision", "r", "", "The revision to get the file contents from") | ||
fileCmd.AddCommand(file_showCmd) | ||
|
||
carapace.Gen(file_showCmd).FlagCompletion(carapace.ActionMap{ | ||
"revision": jj.ActionRevs(jj.RevOption{}.Default()), | ||
}) | ||
|
||
carapace.Gen(file_showCmd).PositionalAnyCompletion( | ||
carapace.ActionCallback(func(c carapace.Context) carapace.Action { | ||
return jj.ActionRevFiles(file_showCmd.Flag("revision").Value.String()) | ||
}), | ||
) | ||
} |
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
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,26 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/carapace-sh/carapace" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/git" | ||
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var git_remote_setUrlCmd = &cobra.Command{ | ||
Use: "set-url [OPTIONS] <REMOTE> <URL>", | ||
Short: "Set the URL of a Git remote", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
func init() { | ||
carapace.Gen(git_remote_setUrlCmd).Standalone() | ||
|
||
git_remote_setUrlCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") | ||
git_remoteCmd.AddCommand(git_remote_setUrlCmd) | ||
|
||
carapace.Gen(git_remote_setUrlCmd).PositionalCompletion( | ||
jj.ActionRemotes(), | ||
git.ActionRepositorySearch(git.SearchOpts{}.Default()), | ||
) | ||
} |
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
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
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
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
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
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
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