From 9eb446a0a90141ef2e45d00630fd01da33383805 Mon Sep 17 00:00:00 2001 From: rsteube Date: Wed, 14 Feb 2024 11:50:59 +0100 Subject: [PATCH] tmp --- completers/dagger_completer/cmd/call.go | 33 --------------- completers/dagger_completer/cmd/completion.go | 18 -------- .../dagger_completer/cmd/completion_bash.go | 19 --------- .../dagger_completer/cmd/completion_fish.go | 19 --------- .../cmd/completion_powershell.go | 19 --------- .../dagger_completer/cmd/completion_zsh.go | 19 --------- completers/dagger_completer/cmd/config.go | 30 -------------- completers/dagger_completer/cmd/develop.go | 30 -------------- completers/dagger_completer/cmd/functions.go | 30 -------------- completers/dagger_completer/cmd/gen.go | 30 -------------- completers/dagger_completer/cmd/help.go | 22 ---------- completers/dagger_completer/cmd/init.go | 34 --------------- completers/dagger_completer/cmd/install.go | 40 ------------------ completers/dagger_completer/cmd/listen.go | 39 ------------------ completers/dagger_completer/cmd/login.go | 19 --------- completers/dagger_completer/cmd/logout.go | 19 --------- completers/dagger_completer/cmd/publish.go | 27 ------------ completers/dagger_completer/cmd/query.go | 33 --------------- completers/dagger_completer/cmd/root.go | 41 ------------------- completers/dagger_completer/cmd/run.go | 22 ---------- completers/dagger_completer/cmd/session.go | 20 --------- completers/dagger_completer/cmd/up.go | 19 --------- completers/dagger_completer/cmd/version.go | 18 -------- completers/dagger_completer/main.go | 7 ---- go.mod | 6 +-- go.sum | 8 ++-- 26 files changed, 6 insertions(+), 615 deletions(-) delete mode 100644 completers/dagger_completer/cmd/call.go delete mode 100644 completers/dagger_completer/cmd/completion.go delete mode 100644 completers/dagger_completer/cmd/completion_bash.go delete mode 100644 completers/dagger_completer/cmd/completion_fish.go delete mode 100644 completers/dagger_completer/cmd/completion_powershell.go delete mode 100644 completers/dagger_completer/cmd/completion_zsh.go delete mode 100644 completers/dagger_completer/cmd/config.go delete mode 100644 completers/dagger_completer/cmd/develop.go delete mode 100644 completers/dagger_completer/cmd/functions.go delete mode 100644 completers/dagger_completer/cmd/gen.go delete mode 100644 completers/dagger_completer/cmd/help.go delete mode 100644 completers/dagger_completer/cmd/init.go delete mode 100644 completers/dagger_completer/cmd/install.go delete mode 100644 completers/dagger_completer/cmd/listen.go delete mode 100644 completers/dagger_completer/cmd/login.go delete mode 100644 completers/dagger_completer/cmd/logout.go delete mode 100644 completers/dagger_completer/cmd/publish.go delete mode 100644 completers/dagger_completer/cmd/query.go delete mode 100644 completers/dagger_completer/cmd/root.go delete mode 100644 completers/dagger_completer/cmd/run.go delete mode 100644 completers/dagger_completer/cmd/session.go delete mode 100644 completers/dagger_completer/cmd/up.go delete mode 100644 completers/dagger_completer/cmd/version.go delete mode 100644 completers/dagger_completer/main.go diff --git a/completers/dagger_completer/cmd/call.go b/completers/dagger_completer/cmd/call.go deleted file mode 100644 index 21100e4843..0000000000 --- a/completers/dagger_completer/cmd/call.go +++ /dev/null @@ -1,33 +0,0 @@ -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(), - }) - - carapace.Gen(callCmd).PositionalAnyCompletion( - dagger.ActionFunctions(), - ) -} diff --git a/completers/dagger_completer/cmd/completion.go b/completers/dagger_completer/cmd/completion.go deleted file mode 100644 index 5e9c0bb93b..0000000000 --- a/completers/dagger_completer/cmd/completion.go +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index f99edddece..0000000000 --- a/completers/dagger_completer/cmd/completion_bash.go +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 466dbec8de..0000000000 --- a/completers/dagger_completer/cmd/completion_fish.go +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 4652e12918..0000000000 --- a/completers/dagger_completer/cmd/completion_powershell.go +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index a30fcf4e41..0000000000 --- a/completers/dagger_completer/cmd/completion_zsh.go +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index ead70964e7..0000000000 --- a/completers/dagger_completer/cmd/config.go +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100644 index a2e92b35a1..0000000000 --- a/completers/dagger_completer/cmd/develop.go +++ /dev/null @@ -1,30 +0,0 @@ -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(), - "sdk": dagger.ActionSdks(), - "source": carapace.ActionDirectories(), - }) -} diff --git a/completers/dagger_completer/cmd/functions.go b/completers/dagger_completer/cmd/functions.go deleted file mode 100644 index d4f114d085..0000000000 --- a/completers/dagger_completer/cmd/functions.go +++ /dev/null @@ -1,30 +0,0 @@ -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(), - }) - - carapace.Gen(functionsCmd).PositionalAnyCompletion( - dagger.ActionFunctions().FilterArgs(), - ) -} diff --git a/completers/dagger_completer/cmd/gen.go b/completers/dagger_completer/cmd/gen.go deleted file mode 100644 index 908d7cf44b..0000000000 --- a/completers/dagger_completer/cmd/gen.go +++ /dev/null @@ -1,30 +0,0 @@ -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 deleted file mode 100644 index dc74c12259..0000000000 --- a/completers/dagger_completer/cmd/help.go +++ /dev/null @@ -1,22 +0,0 @@ -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) - - carapace.Gen(helpCmd).PositionalAnyCompletion( - carapace.ActionCommands(rootCmd), - ) -} diff --git a/completers/dagger_completer/cmd/init.go b/completers/dagger_completer/cmd/init.go deleted file mode 100644 index 149c721a78..0000000000 --- a/completers/dagger_completer/cmd/init.go +++ /dev/null @@ -1,34 +0,0 @@ -package cmd - -import ( - "github.com/rsteube/carapace" - "github.com/rsteube/carapace-bin/pkg/actions/tools/dagger" - "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": dagger.ActionLicenses(), - "sdk": dagger.ActionSdks(), - "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 deleted file mode 100644 index 5657350ce2..0000000000 --- a/completers/dagger_completer/cmd/install.go +++ /dev/null @@ -1,40 +0,0 @@ -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 deleted file mode 100644 index 96fd168319..0000000000 --- a/completers/dagger_completer/cmd/listen.go +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100644 index 25ee2bda9a..0000000000 --- a/completers/dagger_completer/cmd/login.go +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 8de8ce0846..0000000000 --- a/completers/dagger_completer/cmd/logout.go +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index 7efba8f641..0000000000 --- a/completers/dagger_completer/cmd/publish.go +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index cdb05451af..0000000000 --- a/completers/dagger_completer/cmd/query.go +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index a822dc438a..0000000000 --- a/completers/dagger_completer/cmd/root.go +++ /dev/null @@ -1,41 +0,0 @@ -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.", - Long: "https://dagger.io/", - 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 deleted file mode 100644 index 54ee2e7935..0000000000 --- a/completers/dagger_completer/cmd/run.go +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index 3eab992414..0000000000 --- a/completers/dagger_completer/cmd/session.go +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 859e040514..0000000000 --- a/completers/dagger_completer/cmd/up.go +++ /dev/null @@ -1,19 +0,0 @@ -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 deleted file mode 100644 index aa26f1f5cf..0000000000 --- a/completers/dagger_completer/cmd/version.go +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index 20cd48c096..0000000000 --- a/completers/dagger_completer/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "github.com/rsteube/carapace-bin/completers/dagger_completer/cmd" - -func main() { - cmd.Execute() -} diff --git a/go.mod b/go.mod index 2155cb265c..f48948a022 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.21 require ( github.com/pelletier/go-toml v1.9.5 - github.com/rsteube/carapace v0.49.1 + github.com/rsteube/carapace v0.49.2 github.com/rsteube/carapace-bridge v0.2.12 github.com/rsteube/carapace-shlex v0.1.2 - github.com/rsteube/carapace-spec v0.14.1 + github.com/rsteube/carapace-spec v0.15.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 golang.org/x/mod v0.15.0 @@ -25,5 +25,3 @@ require ( ) replace github.com/spf13/pflag => github.com/rsteube/carapace-pflag v0.2.0 - -replace github.com/rsteube/carapace-spec => ../carapace-spec/ diff --git a/go.sum b/go.sum index c33d9026e3..41457d7e91 100644 --- a/go.sum +++ b/go.sum @@ -16,16 +16,16 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rsteube/carapace v0.49.1 h1:ljGQpEkSATpvAnP6eO7Bc1iLJljxgfpCJoCPA/EkQlU= -github.com/rsteube/carapace v0.49.1/go.mod h1:syVOvI8e2rEEK/9aMZxfWuHvcnQK/EcnTV4roClEnLE= +github.com/rsteube/carapace v0.49.2 h1:BMtZK/iGeGFF2cAIn+x0zM46ZbNt7OM+p18sHHXpXm4= +github.com/rsteube/carapace v0.49.2/go.mod h1:syVOvI8e2rEEK/9aMZxfWuHvcnQK/EcnTV4roClEnLE= github.com/rsteube/carapace-bridge v0.2.12 h1:d1kgjgqrmgOa7lHLj/b/esJv692kHSQvTXhmzdx8dwQ= github.com/rsteube/carapace-bridge v0.2.12/go.mod h1:dT8ZptEIYd4zyg5CnPPr+hiLDukPu+lZLcNeyU2Wy2w= github.com/rsteube/carapace-pflag v0.2.0 h1:EYqFO9Haib3NDCPqKu0VxOGi9YQBkXk1IzlHdT0M0vw= github.com/rsteube/carapace-pflag v0.2.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/rsteube/carapace-shlex v0.1.2 h1:ZKjhIfXoCkEnzensMglTaLbkNOaLkmM8SCRshpJKx6s= github.com/rsteube/carapace-shlex v0.1.2/go.mod h1:zPw1dOFwvLPKStUy9g2BYKanI6bsQMATzDMYQQybo3o= -github.com/rsteube/carapace-spec v0.14.1 h1:9DckR9UhpHPcHwOYOpiCPNpsEarc6MFybr9lWTdKEao= -github.com/rsteube/carapace-spec v0.14.1/go.mod h1:EyrGR4+EgH/xtueZo01gfWgCzLqjCpef/kdiC+AYS5M= +github.com/rsteube/carapace-spec v0.15.0 h1:alSQo4qQ8XsyOY9FgpfWNYglYy2PRR93KIQ0oxpiteI= +github.com/rsteube/carapace-spec v0.15.0/go.mod h1:fnR0fPoAVV2ET7nPw5fT89jNBQGgUAF1nmkRvy8zT3M= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=