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: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Aug 26, 2016 at 18:20 UTC
7e5393c4db1619b73e24cd82e842786e3975829e
2 files changed
+3
-3
commands/option.go
+2
-2
@@ -47,8 +47,8 @@ func (o *option) Description() string {
47
o.description += "."
48
}
49
if o.defaultVal != nil {
50
- if strings.Contains(o.description, "<default>") {
51
- return strings.Replace(o.description, "<default>",
50
+ if strings.Contains(o.description, "<<default>>") {
51
+ return strings.Replace(o.description, "<<default>>",
52
fmt.Sprintf("Default: %v.", o.defaultVal), -1)
53
} else {
54
return fmt.Sprintf("%s Default: %v.", o.description, o.defaultVal)
core/commands/publish.go
+1
-1
@@ -52,7 +52,7 @@ Publish an <ipfs-path> to another public key (not implemented):
52
Options: []cmds.Option{
53
cmds.BoolOption("resolve", "Resolve given path before publishing.").Default(true),
54
cmds.StringOption("lifetime", "t",
55
- `Time duration that the record will be valid for. <default>
55
+ `Time duration that the record will be valid for. <<default>>
56
This accepts durations such as "300s", "1.5h" or "2h45m". Valid time units are
57
"ns", "us" (or "µs"), "ms", "s", "m", "h".`).Default("24h"),
58
cmds.StringOption("ttl", "Time duration this record should be cached for (caution: experimental)."),