Add argument pragma for ping and findnode target node

This commit is contained in:
kdeme 2020-06-03 14:17:50 +02:00 committed by zah
parent ff7bed9555
commit 4276e713f4
1 changed files with 7 additions and 3 deletions

View File

@ -37,16 +37,20 @@ type
discard discard
of ping: of ping:
pingTarget* {. pingTarget* {.
argument
desc: "ENR URI of the node to a send ping message" desc: "ENR URI of the node to a send ping message"
name: "node" .}: Node name: "node" .}: Node
of findnode: of findnode:
findNodeTarget* {.
desc: "ENR URI of the node to send a findNode message"
name: "node" .}: Node
distance* {. distance* {.
defaultValue: 255 defaultValue: 255
desc: "Distance parameter for the findNode message" desc: "Distance parameter for the findNode message"
name: "distance" .}: uint32 name: "distance" .}: uint32
# TODO: Order here matters as else the help message does not show all the
# information, see: https://github.com/status-im/nim-confutils/issues/15
findNodeTarget* {.
argument
desc: "ENR URI of the node to send a findNode message"
name: "node" .}: Node
proc parseCmdArg*(T: type enr.Record, p: TaintedString): T = proc parseCmdArg*(T: type enr.Record, p: TaintedString): T =
if not fromURI(result, p): if not fromURI(result, p):