2023-07-28 04:26:48 -04:00
|
|
|
package hints
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"strconv"
|
|
|
|
)
|
|
|
|
|
2024-10-18 18:48:16 -04:00
|
|
|
// Enabled returns whether cli hints are enabled or not. Hints are enabled by
|
|
|
|
// default, but can be disabled through the "DOCKER_CLI_HINTS" environment
|
|
|
|
// variable.
|
2023-07-28 04:26:48 -04:00
|
|
|
func Enabled() bool {
|
|
|
|
if v := os.Getenv("DOCKER_CLI_HINTS"); v != "" {
|
|
|
|
enabled, err := strconv.ParseBool(v)
|
|
|
|
if err != nil {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return enabled
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
}
|