提交 5461d769 作者: Matt Bell

core/commands: Better syntax for 'pin ls' option value handling

上级 928f20b4
......@@ -138,8 +138,10 @@ Use --type=<type> to specify the type of pinned keys to list. Valid values are:
typeStr = "direct"
}
if typeStr != "all" && typeStr != "direct" && typeStr != "indirect" && typeStr != "recursive" {
return nil, cmds.ClientError("Invalid type '" + typeStr + "', must be \"direct\", \"indirect\", \"recursive\", or \"all\"")
switch typeStr {
case "all", "direct", "indirect", "recursive":
default:
return nil, cmds.ClientError("Invalid type '" + typeStr + "', must be one of {direct, indirect, recursive, all}")
}
keys := make([]u.Key, 0)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论