From 7e5393c4db1619b73e24cd82e842786e3975829e Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 26 Aug 2016 18:20:17 +0200 Subject: [PATCH] commands: replace keyword with <> This way if we use in description (we use thigns like already), it won't conflict and modify the description in unwanted way. License: MIT Signed-off-by: Jakub Sztandera --- commands/option.go | 4 ++-- core/commands/publish.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/option.go b/commands/option.go index 2ae524467..5cdf529a4 100644 --- a/commands/option.go +++ b/commands/option.go @@ -47,8 +47,8 @@ func (o *option) Description() string { o.description += "." } if o.defaultVal != nil { - if strings.Contains(o.description, "") { - return strings.Replace(o.description, "", + if strings.Contains(o.description, "<>") { + return strings.Replace(o.description, "<>", fmt.Sprintf("Default: %v.", o.defaultVal), -1) } else { return fmt.Sprintf("%s Default: %v.", o.description, o.defaultVal) diff --git a/core/commands/publish.go b/core/commands/publish.go index 405aae6ad..ac156e401 100644 --- a/core/commands/publish.go +++ b/core/commands/publish.go @@ -52,7 +52,7 @@ Publish an to another public key (not implemented): Options: []cmds.Option{ cmds.BoolOption("resolve", "Resolve given path before publishing.").Default(true), cmds.StringOption("lifetime", "t", - `Time duration that the record will be valid for. + `Time duration that the record will be valid for. <> This accepts durations such as "300s", "1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".`).Default("24h"), cmds.StringOption("ttl", "Time duration this record should be cached for (caution: experimental)."),