Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 831ebeae96 | |||
| fa3e0bcdaf | |||
| 42d4489992 | |||
| 29bd82ba14 | |||
| 12164ff157 | |||
| 06c60dea90 |
17
cli/cobra.go
17
cli/cobra.go
@ -10,6 +10,7 @@ import (
|
||||
cliconfig "github.com/docker/cli/cli/config"
|
||||
cliflags "github.com/docker/cli/cli/flags"
|
||||
"github.com/moby/term"
|
||||
"github.com/morikuni/aec"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
@ -49,7 +50,7 @@ func setupCommonRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *p
|
||||
rootCmd.PersistentFlags().MarkShorthandDeprecated("help", "please use --help")
|
||||
rootCmd.PersistentFlags().Lookup("help").Hidden = true
|
||||
|
||||
rootCmd.Annotations = map[string]string{"additionalHelp": brightCyan("To get more help with docker, check out guides at https://docs.docker.com/go/guides/")}
|
||||
rootCmd.Annotations = map[string]string{"additionalHelp": "To get more help with docker, check out our guides at https://docs.docker.com/go/guides/"}
|
||||
|
||||
return opts, flags, helpCommand
|
||||
}
|
||||
@ -210,7 +211,8 @@ func isExperimental(cmd *cobra.Command) bool {
|
||||
|
||||
func additionalHelp(cmd *cobra.Command) string {
|
||||
if additionalHelp, ok := cmd.Annotations["additionalHelp"]; ok {
|
||||
return additionalHelp
|
||||
style := aec.EmptyBuilder.Bold().ANSI
|
||||
return style.Apply(additionalHelp)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@ -219,16 +221,6 @@ func hasAdditionalHelp(cmd *cobra.Command) bool {
|
||||
return additionalHelp(cmd) != ""
|
||||
}
|
||||
|
||||
var brightCyan = color("\033[1;96m%s\033[0m")
|
||||
|
||||
func color(colorString string) func(...interface{}) string {
|
||||
sprint := func(args ...interface{}) string {
|
||||
return fmt.Sprintf(colorString,
|
||||
fmt.Sprint(args...))
|
||||
}
|
||||
return sprint
|
||||
}
|
||||
|
||||
func isPlugin(cmd *cobra.Command) bool {
|
||||
return cmd.Annotations[pluginmanager.CommandAnnotationPlugin] == "true"
|
||||
}
|
||||
@ -385,6 +377,7 @@ Invalid Plugins:
|
||||
Run '{{.CommandPath}} COMMAND --help' for more information on a command.
|
||||
{{- end}}
|
||||
{{- if hasAdditionalHelp .}}
|
||||
|
||||
{{ additionalHelp . }}
|
||||
{{- end}}
|
||||
`
|
||||
|
||||
@ -50,6 +50,7 @@ The table below provides an overview of the current status of deprecated feature
|
||||
|
||||
Status | Feature | Deprecated | Remove
|
||||
-----------|------------------------------------------------------------------------------------------------------------------------------------|------------|------------
|
||||
Deprecated | [Pulling images from non-compliant image registries](#pulling-images-from-non-compliant-image-registries) | v20.10 | -
|
||||
Deprecated | [Linux containers on Windows (LCOW)](#linux-containers-on-windows-lcow-experimental) | v20.10 | -
|
||||
Deprecated | [Kernel memory limit](#kernel-memory-limit) | v20.10 | -
|
||||
Deprecated | [Classic Swarm and overlay networks using external key/value stores](#classic-swarm-and-overlay-networks-using-cluster-store) | v20.10 | -
|
||||
|
||||
@ -4,8 +4,10 @@ set -eu -o pipefail
|
||||
|
||||
mkdir -p ./man/man1
|
||||
|
||||
# yay, go install creates a binary named "v2" ¯\_(ツ)_/¯
|
||||
go build -o "/go/bin/md2man" ./vendor/github.com/cpuguy83/go-md2man/v2
|
||||
if ! command -v md2man &> /dev/null; then
|
||||
# yay, go install creates a binary named "v2" ¯\_(ツ)_/¯
|
||||
go build -o "/go/bin/md2man" ./vendor/github.com/cpuguy83/go-md2man/v2
|
||||
fi
|
||||
|
||||
# Generate man pages from cobra commands
|
||||
go build -o /tmp/gen-manpages github.com/docker/cli/man
|
||||
|
||||
Reference in New Issue
Block a user