cmd/d2: Avoid duplicate newlines in help output

This commit is contained in:
Anmol Sethi 2022-11-07 16:19:15 -08:00
parent 6128f1102f
commit c3f155a67f

View file

@ -85,10 +85,12 @@ func longLayoutHelp(ctx context.Context, ms *xmain.State) error {
return err
}
if !strings.HasSuffix(pluginInfo.LongHelp, "\n") {
pluginInfo.LongHelp += "\n"
}
fmt.Fprintf(ms.Stdout, `%s (%s):
%s
`, pluginInfo.Name, pluginLocation, pluginInfo.LongHelp)
%s`, pluginInfo.Name, pluginLocation, pluginInfo.LongHelp)
return nil
}