quote values

This commit is contained in:
Roy Olav Purser 2021-06-18 15:17:55 +02:00
parent c7e42dc9c0
commit 7c34548921
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -147,8 +147,8 @@ func (c *Config) help() {
for k, v := range c.env { for k, v := range c.env {
if v.dtype != TypeNone { if v.dtype != TypeNone {
if v.hasdef { if v.hasdef {
format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Default %%s\n", max[0]+3, max[1]+3) format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Default %%s\n", max[0]+5, max[1]+3)
fmt.Printf(format, k, v.dtype, v.defval) fmt.Printf(format, strings.Sprintf(`"%s"`, k), v.dtype, strings.Sprintf(`"%s"`, v.defval))
} }
} }
} }
@ -158,8 +158,8 @@ func (c *Config) help() {
for k, v := range c.env { for k, v := range c.env {
if v.dtype != TypeNone { if v.dtype != TypeNone {
if !v.hasdef { if !v.hasdef {
format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Required\n", max[0]+3, max[1]+3) format := fmt.Sprintf("Variable %%-%ds| Type %%-%ds| Required\n", max[0]+5, max[1]+3)
fmt.Printf(format, k, v.dtype) fmt.Printf(format, strings.Sprintf(`"%s"`, k), v.dtype)
} }
} }
} }