add deprecation message
This commit is contained in:
parent
0705db2f42
commit
f849f14b5f
|
|
@ -45,6 +45,8 @@ var version = noVersion
|
||||||
var (
|
var (
|
||||||
exit = os.Exit
|
exit = os.Exit
|
||||||
|
|
||||||
|
isUnixSocket func() bool // nil when run on non-unix platform
|
||||||
|
|
||||||
flags = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
flags = flag.NewFlagSet(os.Args[0], flag.ExitOnError)
|
||||||
|
|
||||||
help = flags.Bool("help", false, prettify(`
|
help = flags.Bool("help", false, prettify(`
|
||||||
|
|
@ -361,6 +363,9 @@ func main() {
|
||||||
if *format != "json" && *format != "text" {
|
if *format != "json" && *format != "text" {
|
||||||
fail(nil, "The -format option must be 'json' or 'text'.")
|
fail(nil, "The -format option must be 'json' or 'text'.")
|
||||||
}
|
}
|
||||||
|
if isUnixSocket != nil && isUnixSocket() {
|
||||||
|
fail(nil, "The -unix option is deprecated, please use unix://{path} as the address instead.")
|
||||||
|
}
|
||||||
if *emitDefaults && *format != "json" {
|
if *emitDefaults && *format != "json" {
|
||||||
warn("The -emit-defaults is only used when using json format.")
|
warn("The -emit-defaults is only used when using json format.")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || windows
|
||||||
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
var (
|
||||||
|
unix = flags.Bool("unix", false, prettify(`
|
||||||
|
Indicates that the server address is the path to a Unix domain socket.`))
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
isUnixSocket = func() bool {
|
||||||
|
return *unix
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue