From 7a5472153ba488905553ccb91ffd7aa29226d7dc Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 20 Jun 2023 11:42:02 +0200 Subject: [PATCH] docs: set experimental annotation Signed-off-by: CrazyMax --- commands/build.go | 16 +++++++++++----- commands/debug-shell.go | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/commands/build.go b/commands/build.go index 34ca483f..7feee06e 100644 --- a/commands/build.go +++ b/commands/build.go @@ -487,7 +487,8 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { flags.StringArrayVar(&options.platforms, "platform", platformsDefault, "Set target platform for build") if isExperimental() { - flags.StringVar(&options.printFunc, "print", "", "Print result of information request (e.g., outline, targets) [experimental]") + flags.StringVar(&options.printFunc, "print", "", "Print result of information request (e.g., outline, targets)") + flags.SetAnnotation("print", "experimentalCLI", nil) } flags.BoolVar(&options.exportPush, "push", false, `Shorthand for "--output=type=registry"`) @@ -514,10 +515,14 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { flags.StringVar(&options.provenance, "provenance", "", `Shorthand for "--attest=type=provenance"`) if isExperimental() { - flags.StringVar(&invokeFlag, "invoke", "", "Invoke a command after the build [experimental]") - flags.StringVar(&options.Root, "root", "", "Specify root directory of server to connect [experimental]") - flags.BoolVar(&options.Detach, "detach", false, "Detach buildx server (supported only on linux) [experimental]") - flags.StringVar(&options.ServerConfig, "server-config", "", "Specify buildx server config file (used only when launching new server) [experimental]") + flags.StringVar(&invokeFlag, "invoke", "", "Invoke a command after the build") + flags.SetAnnotation("invoke", "experimentalCLI", nil) + flags.StringVar(&options.Root, "root", "", "Specify root directory of server to connect") + flags.SetAnnotation("root", "experimentalCLI", nil) + flags.BoolVar(&options.Detach, "detach", false, "Detach buildx server (supported only on linux)") + flags.SetAnnotation("detach", "experimentalCLI", nil) + flags.StringVar(&options.ServerConfig, "server-config", "", "Specify buildx server config file (used only when launching new server)") + flags.SetAnnotation("server-config", "experimentalCLI", nil) } // hidden flags @@ -540,6 +545,7 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { flags.BoolVar(&ignoreBool, "squash", false, "Squash newly built layers into a single new layer") flags.MarkHidden("squash") flags.SetAnnotation("squash", "flag-warn", []string{"experimental flag squash is removed with BuildKit. You should squash inside build using a multi-stage Dockerfile for efficiency."}) + flags.SetAnnotation("squash", "experimentalCLI", nil) flags.StringVarP(&ignore, "memory", "m", "", "Memory limit") flags.MarkHidden("memory") diff --git a/commands/debug-shell.go b/commands/debug-shell.go index 6b814094..8e255dda 100644 --- a/commands/debug-shell.go +++ b/commands/debug-shell.go @@ -24,6 +24,9 @@ func debugShellCmd(dockerCli command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "debug-shell", Short: "Start a monitor", + Annotations: map[string]string{ + "experimentalCLI": "", + }, RunE: func(cmd *cobra.Command, args []string) error { printer, err := progress.NewPrinter(context.TODO(), os.Stderr, os.Stderr, progressMode) if err != nil { @@ -55,9 +58,15 @@ func debugShellCmd(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() - flags.StringVar(&options.Root, "root", "", "Specify root directory of server to connect [experimental]") - flags.BoolVar(&options.Detach, "detach", runtime.GOOS == "linux", "Detach buildx server (supported only on linux) [experimental]") - flags.StringVar(&options.ServerConfig, "server-config", "", "Specify buildx server config file (used only when launching new server) [experimental]") + flags.StringVar(&options.Root, "root", "", "Specify root directory of server to connect") + flags.SetAnnotation("root", "experimentalCLI", nil) + + flags.BoolVar(&options.Detach, "detach", runtime.GOOS == "linux", "Detach buildx server (supported only on linux)") + flags.SetAnnotation("detach", "experimentalCLI", nil) + + flags.StringVar(&options.ServerConfig, "server-config", "", "Specify buildx server config file (used only when launching new server)") + flags.SetAnnotation("server-config", "experimentalCLI", nil) + flags.StringVar(&progressMode, "progress", "auto", `Set type of progress output ("auto", "plain", "tty"). Use plain to show container output`) return cmd