Commit 52cd6b76 authored by Jakub Sztandera's avatar Jakub Sztandera

commands: replace <default> keyword with <<default>>

This way if we use <default> in description (we use thigns like <hash>
already), it won't conflict and modify the description in unwanted way.

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent 72694ed6
......@@ -47,8 +47,8 @@ func (o *option) Description() string {
o.description += "."
}
if o.defaultVal != nil {
if strings.Contains(o.description, "<default>") {
return strings.Replace(o.description, "<default>",
if strings.Contains(o.description, "<<default>>") {
return strings.Replace(o.description, "<<default>>",
fmt.Sprintf("Default: %v.", o.defaultVal), -1)
} else {
return fmt.Sprintf("%s Default: %v.", o.description, o.defaultVal)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment