diff --git a/completers/dagger_completer/cmd/call.go b/completers/dagger_completer/cmd/call.go new file mode 100644 index 0000000000..78779463e8 --- /dev/null +++ b/completers/dagger_completer/cmd/call.go @@ -0,0 +1,31 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/spf13/cobra" +) + +var callCmd = &cobra.Command{ + Use: "call [flags] [FUNCTION]...", + Short: "Call a module function", + GroupID: "module", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(callCmd).Standalone() + + callCmd.PersistentFlags().Bool("focus", false, "Only show output for focused commands") + callCmd.PersistentFlags().Bool("json", false, "Present result as JSON") + callCmd.PersistentFlags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + callCmd.PersistentFlags().StringP("output", "o", "", "Path in the host to save the result to") + rootCmd.AddCommand(callCmd) + + carapace.Gen(callCmd).FlagCompletion(carapace.ActionMap{ + "mod": dagger.ActionMods(), + "output": carapace.ActionFiles(), + }) + + // TODO positional +} diff --git a/completers/dagger_completer/cmd/completion.go b/completers/dagger_completer/cmd/completion.go new file mode 100644 index 0000000000..5e9c0bb93b --- /dev/null +++ b/completers/dagger_completer/cmd/completion.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var completionCmd = &cobra.Command{ + Use: "completion", + Short: "Generate the autocompletion script for the specified shell", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(completionCmd).Standalone() + + rootCmd.AddCommand(completionCmd) +} diff --git a/completers/dagger_completer/cmd/completion_bash.go b/completers/dagger_completer/cmd/completion_bash.go new file mode 100644 index 0000000000..f99edddece --- /dev/null +++ b/completers/dagger_completer/cmd/completion_bash.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var completion_bashCmd = &cobra.Command{ + Use: "bash", + Short: "Generate the autocompletion script for bash", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(completion_bashCmd).Standalone() + + completion_bashCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions") + completionCmd.AddCommand(completion_bashCmd) +} diff --git a/completers/dagger_completer/cmd/completion_fish.go b/completers/dagger_completer/cmd/completion_fish.go new file mode 100644 index 0000000000..466dbec8de --- /dev/null +++ b/completers/dagger_completer/cmd/completion_fish.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var completion_fishCmd = &cobra.Command{ + Use: "fish", + Short: "Generate the autocompletion script for fish", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(completion_fishCmd).Standalone() + + completion_fishCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions") + completionCmd.AddCommand(completion_fishCmd) +} diff --git a/completers/dagger_completer/cmd/completion_powershell.go b/completers/dagger_completer/cmd/completion_powershell.go new file mode 100644 index 0000000000..4652e12918 --- /dev/null +++ b/completers/dagger_completer/cmd/completion_powershell.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var completion_powershellCmd = &cobra.Command{ + Use: "powershell", + Short: "Generate the autocompletion script for powershell", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(completion_powershellCmd).Standalone() + + completion_powershellCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions") + completionCmd.AddCommand(completion_powershellCmd) +} diff --git a/completers/dagger_completer/cmd/completion_zsh.go b/completers/dagger_completer/cmd/completion_zsh.go new file mode 100644 index 0000000000..a30fcf4e41 --- /dev/null +++ b/completers/dagger_completer/cmd/completion_zsh.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var completion_zshCmd = &cobra.Command{ + Use: "zsh", + Short: "Generate the autocompletion script for zsh", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(completion_zshCmd).Standalone() + + completion_zshCmd.Flags().Bool("no-descriptions", false, "disable completion descriptions") + completionCmd.AddCommand(completion_zshCmd) +} diff --git a/completers/dagger_completer/cmd/config.go b/completers/dagger_completer/cmd/config.go new file mode 100644 index 0000000000..ead70964e7 --- /dev/null +++ b/completers/dagger_completer/cmd/config.go @@ -0,0 +1,30 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/spf13/cobra" +) + +var configCmd = &cobra.Command{ + Use: "config", + Short: "Get or set the configuration of a Dagger module", + GroupID: "module", + Aliases: []string{"mod"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(configCmd).Standalone() + configCmd.AddGroup( + &cobra.Group{ID: "module", Title: ""}, + ) + + configCmd.PersistentFlags().Bool("focus", false, "Only show output for focused commands") + configCmd.PersistentFlags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + rootCmd.AddCommand(configCmd) + + carapace.Gen(configCmd).FlagCompletion(carapace.ActionMap{ + "mod": dagger.ActionMods(), + }) +} diff --git a/completers/dagger_completer/cmd/develop.go b/completers/dagger_completer/cmd/develop.go new file mode 100644 index 0000000000..2aa61049b3 --- /dev/null +++ b/completers/dagger_completer/cmd/develop.go @@ -0,0 +1,30 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/spf13/cobra" +) + +var developCmd = &cobra.Command{ + Use: "develop", + Short: "Setup or update all the resources needed to develop on a module locally", + GroupID: "module", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(developCmd).Standalone() + + developCmd.PersistentFlags().Bool("focus", false, "Only show output for focused commands") + developCmd.PersistentFlags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + developCmd.Flags().String("sdk", "", "New SDK for the module") + developCmd.Flags().String("source", "", "Directory to store the module implementation source code in") + rootCmd.AddCommand(developCmd) + + carapace.Gen(developCmd).FlagCompletion(carapace.ActionMap{ + "mod": dagger.ActionMods(), + // TODO "sdk": + "source": carapace.ActionDirectories(), + }) +} diff --git a/completers/dagger_completer/cmd/functions.go b/completers/dagger_completer/cmd/functions.go new file mode 100644 index 0000000000..28dbf075ad --- /dev/null +++ b/completers/dagger_completer/cmd/functions.go @@ -0,0 +1,28 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/spf13/cobra" +) + +var functionsCmd = &cobra.Command{ + Use: "functions [flags] [FUNCTION]...", + Short: "List available functions", + GroupID: "module", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(functionsCmd).Standalone() + + functionsCmd.PersistentFlags().Bool("focus", false, "Only show output for focused commands") + functionsCmd.PersistentFlags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + rootCmd.AddCommand(functionsCmd) + + carapace.Gen(functionsCmd).FlagCompletion(carapace.ActionMap{ + "mod": dagger.ActionMods(), + }) + + // TODO positional +} diff --git a/completers/dagger_completer/cmd/gen.go b/completers/dagger_completer/cmd/gen.go new file mode 100644 index 0000000000..908d7cf44b --- /dev/null +++ b/completers/dagger_completer/cmd/gen.go @@ -0,0 +1,30 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var genCmd = &cobra.Command{ + Use: "gen FILE", + Short: "Generate CLI reference documentation", + Hidden: true, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(genCmd).Standalone() + + genCmd.Flags().String("frontmatter", "", "Prepend content to beginning of generated file") + genCmd.Flags().Bool("include-experimental", false, "Show experimental commands in the generated documentation") + genCmd.Flags().StringP("output", "o", "", "Save to file") + rootCmd.AddCommand(genCmd) + + carapace.Gen(genCmd).FlagCompletion(carapace.ActionMap{ + "output": carapace.ActionFiles(), + }) + + carapace.Gen(genCmd).PositionalCompletion( + carapace.ActionFiles(), + ) +} diff --git a/completers/dagger_completer/cmd/help.go b/completers/dagger_completer/cmd/help.go new file mode 100644 index 0000000000..c742c862b0 --- /dev/null +++ b/completers/dagger_completer/cmd/help.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var helpCmd = &cobra.Command{ + Use: "help [command]", + Short: "Help about any command", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(helpCmd).Standalone() + + rootCmd.AddCommand(helpCmd) +} diff --git a/completers/dagger_completer/cmd/init.go b/completers/dagger_completer/cmd/init.go new file mode 100644 index 0000000000..5618b9d8b3 --- /dev/null +++ b/completers/dagger_completer/cmd/init.go @@ -0,0 +1,33 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var initCmd = &cobra.Command{ + Use: "init [flags] [PATH]", + Short: "Initialize a new Dagger module", + GroupID: "module", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(initCmd).Standalone() + + initCmd.Flags().String("license", "", "License identifier to generate - see https://spdx.org/licenses/") + initCmd.Flags().String("name", "", "Name of the new module (defaults to parent directory name)") + initCmd.Flags().String("sdk", "", "Optionally initialize module for development in the given SDK") + initCmd.Flags().String("source", "", "Directory to store the module implementation source code in (defaults to \"dagger/ if \"--sdk\" is provided)") + rootCmd.AddCommand(initCmd) + + carapace.Gen(initCmd).FlagCompletion(carapace.ActionMap{ + // "license": carapace.ActionValues(), TODO + // "sdk": carapace.ActionValues(), TODO + "source": carapace.ActionDirectories(), + }) + + carapace.Gen(initCmd).PositionalCompletion( + carapace.ActionDirectories(), + ) +} diff --git a/completers/dagger_completer/cmd/install.go b/completers/dagger_completer/cmd/install.go new file mode 100644 index 0000000000..5657350ce2 --- /dev/null +++ b/completers/dagger_completer/cmd/install.go @@ -0,0 +1,40 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/rsteube/carapace-bin/pkg/actions/tools/git" + "github.com/spf13/cobra" +) + +var installCmd = &cobra.Command{ + Use: "install [flags] MODULE", + Short: "Add a new dependency to a Dagger module", + GroupID: "module", + Aliases: []string{"use"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(installCmd).Standalone() + + installCmd.Flags().Bool("focus", false, "Only show output for focused commands") + installCmd.Flags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + installCmd.Flags().StringP("name", "n", "", "Name to use for the dependency in the module. Defaults to the name of the module being installed.") + rootCmd.AddCommand(installCmd) + + carapace.Gen(installCmd).FlagCompletion(carapace.ActionMap{ + "mod": dagger.ActionMods(), + }) + + carapace.Gen(installCmd).PositionalCompletion( + carapace.ActionMultiPartsN("@", 2, func(c carapace.Context) carapace.Action { + switch len(c.Parts) { + case 0: + return git.ActionRepositorySearch(git.SearchOpts{Github: true}) + default: + return git.ActionLsRemoteRefs(git.LsRemoteRefOption{Url: "https://" + c.Parts[0], Branches: true, Tags: true}) + } + }), + ) +} diff --git a/completers/dagger_completer/cmd/listen.go b/completers/dagger_completer/cmd/listen.go new file mode 100644 index 0000000000..96fd168319 --- /dev/null +++ b/completers/dagger_completer/cmd/listen.go @@ -0,0 +1,39 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/net" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/spf13/cobra" +) + +var listenCmd = &cobra.Command{ + Use: "listen", + Short: "Starts the engine server", + Aliases: []string{"l"}, + Hidden: true, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(listenCmd).Standalone() + + listenCmd.Flags().Bool("allow-cors", false, "allow Cross-Origin Resource Sharing (CORS) requests") + listenCmd.Flags().Bool("disable-host-read-write", false, "disable host read/write access") + listenCmd.PersistentFlags().Bool("focus", false, "Only show output for focused commands") + listenCmd.Flags().String("listen", "", "Listen on network address ADDR") + listenCmd.PersistentFlags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + rootCmd.AddCommand(listenCmd) + + carapace.Gen(listenCmd).FlagCompletion(carapace.ActionMap{ + "listen": carapace.ActionMultiPartsN(":", 2, func(c carapace.Context) carapace.Action { + switch len(c.Parts) { + case 0: + return carapace.ActionValues() + default: + return net.ActionPorts() + } + }), + "mod": dagger.ActionMods(), + }) +} diff --git a/completers/dagger_completer/cmd/login.go b/completers/dagger_completer/cmd/login.go new file mode 100644 index 0000000000..25ee2bda9a --- /dev/null +++ b/completers/dagger_completer/cmd/login.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var loginCmd = &cobra.Command{ + Use: "login", + Short: "Log in to Dagger Cloud", + GroupID: "cloud", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(loginCmd).Standalone() + + rootCmd.AddCommand(loginCmd) +} diff --git a/completers/dagger_completer/cmd/logout.go b/completers/dagger_completer/cmd/logout.go new file mode 100644 index 0000000000..8de8ce0846 --- /dev/null +++ b/completers/dagger_completer/cmd/logout.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var logoutCmd = &cobra.Command{ + Use: "logout", + Short: "Log out from Dagger Cloud", + GroupID: "cloud", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(logoutCmd).Standalone() + + rootCmd.AddCommand(logoutCmd) +} diff --git a/completers/dagger_completer/cmd/publish.go b/completers/dagger_completer/cmd/publish.go new file mode 100644 index 0000000000..7efba8f641 --- /dev/null +++ b/completers/dagger_completer/cmd/publish.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/spf13/cobra" +) + +var publishCmd = &cobra.Command{ + Use: "publish", + Short: "Publish a Dagger module to the Daggerverse", + GroupID: "module", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(publishCmd).Standalone() + + publishCmd.Flags().Bool("focus", false, "Only show output for focused commands") + publishCmd.Flags().BoolP("force", "f", false, "Force publish even if the git repository is not clean") + publishCmd.Flags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + rootCmd.AddCommand(publishCmd) + + carapace.Gen(publishCmd).FlagCompletion(carapace.ActionMap{ + "mod": dagger.ActionMods(), + }) +} diff --git a/completers/dagger_completer/cmd/query.go b/completers/dagger_completer/cmd/query.go new file mode 100644 index 0000000000..cdb05451af --- /dev/null +++ b/completers/dagger_completer/cmd/query.go @@ -0,0 +1,33 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" + "github.com/spf13/cobra" +) + +var queryCmd = &cobra.Command{ + Use: "query [flags] [OPERATION]", + Short: "Send API queries to a dagger engine", + GroupID: "exec", + Aliases: []string{"q"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(queryCmd).Standalone() + + queryCmd.Flags().String("doc", "", "Read query from file (defaults to reading from stdin)") + queryCmd.PersistentFlags().Bool("focus", false, "Only show output for focused commands") + queryCmd.PersistentFlags().StringP("mod", "m", "", "Path to dagger.json config file for the module or a directory containing that file. Either local path (e.g. \"/path/to/some/dir\") or a github repo (e.g. \"github.com/dagger/dagger/path/to/some/subdir\")") + queryCmd.Flags().StringSlice("var", []string{}, "List of query variables, in key=value format") + queryCmd.Flags().String("var-json", "", "Query variables in JSON format (overrides --var)") + rootCmd.AddCommand(queryCmd) + + carapace.Gen(queryCmd).FlagCompletion(carapace.ActionMap{ + "doc": carapace.ActionFiles(), + "mod": dagger.ActionMods(), + }) + + // TODO positional +} diff --git a/completers/dagger_completer/cmd/root.go b/completers/dagger_completer/cmd/root.go new file mode 100644 index 0000000000..d7275f37bf --- /dev/null +++ b/completers/dagger_completer/cmd/root.go @@ -0,0 +1,40 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "dagger", + Short: "The Dagger CLI provides a command-line interface to Dagger.", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func Execute() error { + return rootCmd.Execute() +} + +func init() { + carapace.Gen(rootCmd).Standalone() + rootCmd.AddGroup( + &cobra.Group{ID: "module", Title: ""}, + &cobra.Group{ID: "cloud", Title: ""}, + &cobra.Group{ID: "exec", Title: ""}, + ) + + rootCmd.PersistentFlags().String("api", "", "Dagger Cloud API URL") + rootCmd.PersistentFlags().Bool("debug", false, "Show more information for debugging") + rootCmd.PersistentFlags().BoolP("help", "h", false, "Print usage") + rootCmd.PersistentFlags().String("progress", "", "progress output format (auto, plain, tty)") + rootCmd.PersistentFlags().BoolP("silent", "s", false, "disable terminal UI and progress output") + rootCmd.PersistentFlags().String("workdir", "", "The host workdir loaded into dagger") + rootCmd.Flag("api").Hidden = true + rootCmd.Flag("help").Hidden = true + rootCmd.Flag("workdir").Hidden = true + + carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{ + "progress": carapace.ActionValues("auto", "plain", "tty"), + "workdir": carapace.ActionDirectories(), + }) +} diff --git a/completers/dagger_completer/cmd/run.go b/completers/dagger_completer/cmd/run.go new file mode 100644 index 0000000000..54ee2e7935 --- /dev/null +++ b/completers/dagger_completer/cmd/run.go @@ -0,0 +1,22 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var runCmd = &cobra.Command{ + Use: "run [flags] COMMAND", + Short: "Run a command in a Dagger session", + GroupID: "exec", + Aliases: []string{"r"}, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(runCmd).Standalone() + + runCmd.Flags().String("cleanup-timeout", "", "max duration to wait between SIGTERM and SIGKILL on interrupt") + runCmd.Flags().Bool("focus", false, "Only show output for focused commands.") + rootCmd.AddCommand(runCmd) +} diff --git a/completers/dagger_completer/cmd/session.go b/completers/dagger_completer/cmd/session.go new file mode 100644 index 0000000000..3eab992414 --- /dev/null +++ b/completers/dagger_completer/cmd/session.go @@ -0,0 +1,20 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var sessionCmd = &cobra.Command{ + Use: "session", + Short: "", + Hidden: true, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(sessionCmd).Standalone() + + sessionCmd.Flags().String("label", "", "label that identifies the source of this session (e.g, --label 'dagger.io/sdk.name:python' --label 'dagger.io/sdk.version:0.5.2' --label 'dagger.io/sdk.async:true')") + rootCmd.AddCommand(sessionCmd) +} diff --git a/completers/dagger_completer/cmd/up.go b/completers/dagger_completer/cmd/up.go new file mode 100644 index 0000000000..859e040514 --- /dev/null +++ b/completers/dagger_completer/cmd/up.go @@ -0,0 +1,19 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var upCmd = &cobra.Command{ + Use: "up", + Short: "Start a service and expose its ports to the host", + Hidden: true, + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(upCmd).Standalone() + + rootCmd.AddCommand(upCmd) +} diff --git a/completers/dagger_completer/cmd/version.go b/completers/dagger_completer/cmd/version.go new file mode 100644 index 0000000000..aa26f1f5cf --- /dev/null +++ b/completers/dagger_completer/cmd/version.go @@ -0,0 +1,18 @@ +package cmd + +import ( + "github.com/rsteube/carapace" + "github.com/spf13/cobra" +) + +var versionCmd = &cobra.Command{ + Use: "version", + Short: "Print dagger version", + Run: func(cmd *cobra.Command, args []string) {}, +} + +func init() { + carapace.Gen(versionCmd).Standalone() + + rootCmd.AddCommand(versionCmd) +} diff --git a/completers/dagger_completer/main.go b/completers/dagger_completer/main.go new file mode 100644 index 0000000000..20cd48c096 --- /dev/null +++ b/completers/dagger_completer/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/rsteube/carapace-bin/completers/dagger_completer/cmd" + +func main() { + cmd.Execute() +} diff --git a/pkg/actions/tools/dagger/mod.go b/pkg/actions/tools/dagger/mod.go new file mode 100644 index 0000000000..066fa75f7b --- /dev/null +++ b/pkg/actions/tools/dagger/mod.go @@ -0,0 +1,13 @@ +package dagger + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bin/pkg/actions/tools/git" +) + +func ActionMods() carapace.Action { + return carapace.Batch( + carapace.ActionFiles(), + git.ActionRepositorySearch(git.SearchOpts{Github: true}), + ).ToA() +}