diff --git a/completers/jj_completer/cmd/bookmark_help.go b/completers/jj_completer/cmd/bookmark_help.go deleted file mode 100644 index 7f51615ec9..0000000000 --- a/completers/jj_completer/cmd/bookmark_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var bookmark_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(bookmark_helpCmd).Standalone() - - bookmarkCmd.AddCommand(bookmark_helpCmd) - - carapace.Gen(bookmark_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(bookmarkCmd), - ) -} diff --git a/completers/jj_completer/cmd/bookmark_list.go b/completers/jj_completer/cmd/bookmark_list.go index 8b1dd34ef0..5e06e0c6ed 100644 --- a/completers/jj_completer/cmd/bookmark_list.go +++ b/completers/jj_completer/cmd/bookmark_list.go @@ -19,6 +19,7 @@ func init() { bookmark_listCmd.Flags().BoolP("all-remotes", "a", false, "Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks") bookmark_listCmd.Flags().BoolP("conflicted", "c", false, "Show only conflicted bookmarks") bookmark_listCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") + bookmark_listCmd.Flags().StringSlice("remote", []string{}, "Show all tracking and non-tracking remote bookmarks belonging to this remote") bookmark_listCmd.Flags().StringSliceP("revisions", "r", []string{}, "Show bookmarks whose local targets are in the given revisions") bookmark_listCmd.Flags().StringP("template", "T", "", "Render each bookmark using the given template") @@ -27,6 +28,7 @@ func init() { bookmarkCmd.AddCommand(bookmark_listCmd) carapace.Gen(bookmark_listCmd).FlagCompletion(carapace.ActionMap{ + "remote": jj.ActionRemotes(), "revisions": jj.ActionRevSets(jj.RevOption{}.Default()).UniqueList(","), }) diff --git a/completers/jj_completer/cmd/config_help.go b/completers/jj_completer/cmd/config_help.go deleted file mode 100644 index 0e784c36d3..0000000000 --- a/completers/jj_completer/cmd/config_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var config_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(config_helpCmd).Standalone() - - configCmd.AddCommand(config_helpCmd) - - carapace.Gen(config_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(configCmd), - ) -} diff --git a/completers/jj_completer/cmd/config_unset.go b/completers/jj_completer/cmd/config_unset.go new file mode 100644 index 0000000000..436e5c604e --- /dev/null +++ b/completers/jj_completer/cmd/config_unset.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj" + "github.com/spf13/cobra" +) + +var config_unsetCmd = &cobra.Command{ + Use: "unset [OPTIONS] <--user|--repo> ", + Short: "Update config file to unset the given option", + Aliases: []string{}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(config_unsetCmd).Standalone() + + config_unsetCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") + config_unsetCmd.Flags().Bool("repo", false, "Target the repo-level config") + config_unsetCmd.Flags().Bool("user", false, "Target the user-level config") + configCmd.AddCommand(config_unsetCmd) + + carapace.Gen(config_unsetCmd).PositionalCompletion( + jj.ActionConfigs(true).MultiParts("."), + ) +} diff --git a/completers/jj_completer/cmd/diff.go b/completers/jj_completer/cmd/diff.go index 48ea2701e4..c3d945e612 100644 --- a/completers/jj_completer/cmd/diff.go +++ b/completers/jj_completer/cmd/diff.go @@ -21,6 +21,8 @@ func init() { diffCmd.Flags().String("from", "", "Show changes from this revision") diffCmd.Flags().Bool("git", false, "Show a Git-format diff") diffCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") + diffCmd.Flags().BoolP("ignore-all-space", "w", false, "Ignore whitespace when comparing lines") + diffCmd.Flags().BoolP("ignore-space-change", "b", false, " Ignore changes in amount of whitespace when comparing lines") diffCmd.Flags().Bool("name-only", false, "For each path, show only its path") diffCmd.Flags().StringP("revision", "r", "", "Show changes in this revision, compared to its parent(s)") diffCmd.Flags().Bool("stat", false, "Show a histogram of the changes") diff --git a/completers/jj_completer/cmd/file_annotate.go b/completers/jj_completer/cmd/file_annotate.go new file mode 100644 index 0000000000..352ba2e69a --- /dev/null +++ b/completers/jj_completer/cmd/file_annotate.go @@ -0,0 +1,29 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj" + "github.com/spf13/cobra" +) + +var file_annotateCmd = &cobra.Command{ + Use: "annotate [OPTIONS] ...", + Short: "Show the source change for each line of the target file", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(file_annotateCmd).Standalone() + + file_annotateCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") + file_annotateCmd.Flags().StringP("revision", "r", "@", "Revision to start at") + fileCmd.AddCommand(file_annotateCmd) + + carapace.Gen(file_annotateCmd).FlagCompletion(carapace.ActionMap{ + "revision": jj.ActionRevs(jj.RevOption{}.Default()).UniqueList(","), + }) + + carapace.Gen(file_annotateCmd).PositionalAnyCompletion( + carapace.ActionFiles().FilterArgs(), + ) +} diff --git a/completers/jj_completer/cmd/file_help.go b/completers/jj_completer/cmd/file_help.go deleted file mode 100644 index 8493b41362..0000000000 --- a/completers/jj_completer/cmd/file_help.go +++ /dev/null @@ -1,22 +0,0 @@ -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), - ) -} diff --git a/completers/jj_completer/cmd/git_clone.go b/completers/jj_completer/cmd/git_clone.go index 84abb3f7c5..fc2e4342c9 100644 --- a/completers/jj_completer/cmd/git_clone.go +++ b/completers/jj_completer/cmd/git_clone.go @@ -16,6 +16,7 @@ func init() { carapace.Gen(git_cloneCmd).Standalone() git_cloneCmd.Flags().Bool("colocate", false, "Whether or not to colocate the Jujutsu repo with the git repo") + git_cloneCmd.Flags().Int("depth", 0, "Create a shallow clone of the given depth") git_cloneCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") git_cloneCmd.Flags().String("remote", "origin", "Name of the newly created remote") gitCmd.AddCommand(git_cloneCmd) diff --git a/completers/jj_completer/cmd/git_help.go b/completers/jj_completer/cmd/git_help.go deleted file mode 100644 index c61e799ef4..0000000000 --- a/completers/jj_completer/cmd/git_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var git_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(git_helpCmd).Standalone() - - gitCmd.AddCommand(git_helpCmd) - - carapace.Gen(git_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(gitCmd), - ) -} diff --git a/completers/jj_completer/cmd/git_remote_help.go b/completers/jj_completer/cmd/git_remote_help.go deleted file mode 100644 index b83bad5034..0000000000 --- a/completers/jj_completer/cmd/git_remote_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var git_remote_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(git_remote_helpCmd).Standalone() - - git_remoteCmd.AddCommand(git_remote_helpCmd) - - carapace.Gen(git_remote_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(git_remoteCmd), - ) -} diff --git a/completers/jj_completer/cmd/help.go b/completers/jj_completer/cmd/help.go index e1f51fdde7..7ca20d7b4a 100644 --- a/completers/jj_completer/cmd/help.go +++ b/completers/jj_completer/cmd/help.go @@ -14,8 +14,16 @@ var helpCmd = &cobra.Command{ func init() { carapace.Gen(helpCmd).Standalone() + helpCmd.Flags().Bool("help", false, "Print help (see more with '--help')") + helpCmd.Flags().StringArrayP("keyword", "k", []string{}, "Show help for keywords instead of commands") rootCmd.AddCommand(helpCmd) + helpCmd.MarkFlagsMutuallyExclusive("help", "keyword") + + carapace.Gen(helpCmd).FlagCompletion(carapace.ActionMap{ + "keyword": carapace.ActionValues("revsets", "tutorial"), + }) + carapace.Gen(helpCmd).PositionalAnyCompletion( carapace.ActionCommands(rootCmd), ) diff --git a/completers/jj_completer/cmd/operation_help.go b/completers/jj_completer/cmd/operation_help.go deleted file mode 100644 index 7f3ab9ecf9..0000000000 --- a/completers/jj_completer/cmd/operation_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var operation_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(operation_helpCmd).Standalone() - - operationCmd.AddCommand(operation_helpCmd) - - carapace.Gen(operation_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(operationCmd), - ) -} diff --git a/completers/jj_completer/cmd/simplifyParents.go b/completers/jj_completer/cmd/simplifyParents.go new file mode 100644 index 0000000000..e7e571c4b5 --- /dev/null +++ b/completers/jj_completer/cmd/simplifyParents.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/carapace-sh/carapace" + "github.com/carapace-sh/carapace-bin/pkg/actions/tools/jj" + "github.com/spf13/cobra" +) + +var simplifyParentsCmd = &cobra.Command{ + Use: "simplify-parents <--source |--revisions >", + Short: "Simplify parent edges for the specified revision(s)", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(simplifyParentsCmd).Standalone() + + simplifyParentsCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") + simplifyParentsCmd.Flags().StringArrayP("revisions", "r", []string{}, "Simplify specified revision(s) (can be repeated)") + simplifyParentsCmd.Flags().StringArrayP("source", "s", []string{}, "Simplify specified revision(s) together with their trees of descendants (can be repeated)") + rootCmd.AddCommand(simplifyParentsCmd) + + carapace.Gen(simplifyParentsCmd).FlagCompletion(carapace.ActionMap{ + "revisions": jj.ActionRevs(jj.RevOption{}.Default()).FilterArgs(), + "source": jj.ActionRevs(jj.RevOption{}.Default()).FilterArgs(), + }) +} diff --git a/completers/jj_completer/cmd/sparse_help.go b/completers/jj_completer/cmd/sparse_help.go deleted file mode 100644 index dcaa144823..0000000000 --- a/completers/jj_completer/cmd/sparse_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var sparse_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(sparse_helpCmd).Standalone() - - sparseCmd.AddCommand(sparse_helpCmd) - - carapace.Gen(sparse_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(sparseCmd), - ) -} diff --git a/completers/jj_completer/cmd/squash.go b/completers/jj_completer/cmd/squash.go index 0eba5d3ffa..72efa52ecc 100644 --- a/completers/jj_completer/cmd/squash.go +++ b/completers/jj_completer/cmd/squash.go @@ -16,10 +16,10 @@ var squashCmd = &cobra.Command{ func init() { carapace.Gen(squashCmd).Standalone() - squashCmd.Flags().String("from", "@", "Revision to squash from") + squashCmd.Flags().StringP("from", "f", "@", "Revision to squash from") squashCmd.Flags().BoolP("help", "h", false, "Print help (see more with '--help')") squashCmd.Flags().BoolP("interactive", "i", false, "Interactively choose which parts to squash") - squashCmd.Flags().String("into", "@", "Revision to squash into") + squashCmd.Flags().StringP("into", "t", "@", "Revision to squash into") squashCmd.Flags().BoolP("keep-emptied", "k", false, "The source revision will not be abandoned") squashCmd.Flags().StringSliceP("message", "m", []string{}, "The description to use for squashed revision (don't open editor)") squashCmd.Flags().StringP("revision", "r", "@", "Revision to squash into its parent") diff --git a/completers/jj_completer/cmd/tag_help.go b/completers/jj_completer/cmd/tag_help.go deleted file mode 100644 index 1da6ed02a6..0000000000 --- a/completers/jj_completer/cmd/tag_help.go +++ /dev/null @@ -1,18 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var tag_helpCmd = &cobra.Command{ - Use: "help", - Short: "Print this message or the help of given subcommand(s)", - Run: func(cmd *cobra.Command, args []string) {}, -} - -func init() { - carapace.Gen(tag_helpCmd).Standalone() - - tagCmd.AddCommand(tag_helpCmd) -} diff --git a/completers/jj_completer/cmd/util_help.go b/completers/jj_completer/cmd/util_help.go deleted file mode 100644 index a823f24b20..0000000000 --- a/completers/jj_completer/cmd/util_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var util_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(util_helpCmd).Standalone() - - utilCmd.AddCommand(util_helpCmd) - - carapace.Gen(util_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(utilCmd), - ) -} diff --git a/completers/jj_completer/cmd/workspace_help.go b/completers/jj_completer/cmd/workspace_help.go deleted file mode 100644 index e44814b44c..0000000000 --- a/completers/jj_completer/cmd/workspace_help.go +++ /dev/null @@ -1,22 +0,0 @@ -package cmd - -import ( - "github.com/carapace-sh/carapace" - "github.com/spf13/cobra" -) - -var workspace_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(workspace_helpCmd).Standalone() - - workspaceCmd.AddCommand(workspace_helpCmd) - - carapace.Gen(workspace_helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(workspaceCmd), - ) -} diff --git a/pkg/actions/tools/jj/rev.go b/pkg/actions/tools/jj/rev.go index 1489ac8109..87a829a7d8 100644 --- a/pkg/actions/tools/jj/rev.go +++ b/pkg/actions/tools/jj/rev.go @@ -108,5 +108,7 @@ func ActionRevSetFunctions() carapace.Action { "committer_date", "Commits with committer dates matching the specified date pattern", "tracked_remote_bookmarks", "All targets of tracked remote bookmarks", "untracked_remote_bookmarks", "All targets of untracked remote bookmarks", + "coalesce", "Get first non-none revset from a list of revsets", + "at_operation", "Query revisions based on historical state", ).Tag("revset functions") }