mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
docs(server/config.go): minor formatting changes
When -version or -help are given, don't warn about having to derive the data directory name. Print warnings about deprecated options on separate lines so the log isn't screwy.
This commit is contained in:
parent
fd0d0813ce
commit
af3240fa18
@ -277,7 +277,7 @@ func (c *Config) LoadFlags(arguments []string) error {
|
||||
// Print deprecation warnings on STDERR.
|
||||
f.Visit(func(f *flag.Flag) {
|
||||
if len(newFlagNameLookup[f.Name]) > 0 {
|
||||
fmt.Fprintf(os.Stderr, "[deprecated] use -%s, not -%s", newFlagNameLookup[f.Name], f.Name)
|
||||
fmt.Fprintf(os.Stderr, "[deprecated] use -%s, not -%s\n", newFlagNameLookup[f.Name], f.Name)
|
||||
}
|
||||
})
|
||||
|
||||
@ -416,7 +416,7 @@ func (c *Config) Sanitize() error {
|
||||
c.NameFromHostname()
|
||||
}
|
||||
|
||||
if c.DataDir == "" && c.Name != "" {
|
||||
if c.DataDir == "" && c.Name != "" && !c.ShowVersion && !c.ShowHelp {
|
||||
c.DataDirFromName()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user