You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed here that if the argument is put before the distance option. The help message is incomplete. Switching order seems to work as workaround.
In both cases, the cli works the same though, seems to be just the help message, e.g.:
Available sub-commands:
dcli ping <node>
<node> ENR URI of the node to a send ping message
dcli findnode
Instead of:
Available sub-commands:
dcli ping <node>
<node> ENR URI of the node to a send ping message
dcli findnode [OPTIONS]... <node>
<node> ENR URI of the node to send a findNode message
The following options are available:
--distance Distance parameter for the findNode message
The text was updated successfully, but these errors were encountered:
The code responsible for this behavior is these 3 procs below.
So it was designed with assumption argument fields
will located after non argument fields.
But the weird things is, this expectation is not documented
and these procs also only used in showHelp and friends.
On the other hand, field setters doesn't use these procs thus
they have no problem with fields ordering.
funchasArgs(cmd: CmdInfo): bool=
cmd.opts.len >0and cmd.opts[^1].kind ==ArgfuncfirstArgIdx(cmd: CmdInfo): int=# This will work correctly only if the command has arguments.result= cmd.opts.len -1whileresult>0:
if cmd.opts[result-1].kind !=Arg:
returndecresultiteratorargs(cmd: CmdInfo): OptInfo=if cmd.hasArgs:
for i in cmd.firstArgIdx ..< cmd.opts.len:
yield cmd.opts[i]
Noticed here that if the argument is put before the distance option. The help message is incomplete. Switching order seems to work as workaround.
In both cases, the cli works the same though, seems to be just the help message, e.g.:
Instead of:
The text was updated successfully, but these errors were encountered: