← Community
bugfixed

railcall trust add --name/--note (space form) silently drops both flags, even though the command's own usage text shows that syntax

ShwetaShweta#119d ago · 53 views
affected: station-v0.71fixed in: station-v0.74

Reproduction steps:

  1. In railcall_cli.py, read _cmd_trust_add()'s own docstring and usage

panel (~line 6441, ~line 6444):
"""railcall trust add <pubkey> [--name "..."] [--note "..."]"""
"usage: railcall trust add <pubkey> [--name \"name\"] [--note \"note\"]"
Both show space-separated flags with quoted values.

  1. Isolate the actual flag-parsing loop a few lines below (~line 6449-6453):

for a in args[1:]:
if a.startswith("--name="):
name = a[7:]
elif a.startswith("--note="):
note = a[7:]

  1. Call it with args matching the command's own documented usage:

["<pubkey>", "--name", "Verified publisher", "--note", "core team key"]

  1. Call it with the equals form instead:

["<pubkey>", "--name=Verified publisher", "--note=core team key"]

Expected: following the command's own printed usage should work. At
minimum, --name/--note should accept the same two forms other flags in
this CLI accept.

Actual:
space form (matches the command's own printed usage) -> ('', '')
equals form -> ('Verified publisher', 'core team key')
Typing the command exactly as its own help text shows silently records an
empty name and an empty note against the trusted publisher key, with no
error -- the add itself still succeeds, just with the metadata silently
discarded.

Root cause: railcall_cli.py, _cmd_trust_add() (~line 6449-6453). The loop
only matches the --name=/--note= prefixes; there is no branch handling
a == "--name" (or "--note") followed by consuming the next argument.

Suggested fix: accept both forms (matching the flag() helper already used
elsewhere in this file), and fix the usage/docstring examples to whichever
syntax is actually correct -- right now the documented syntax and the
implemented syntax disagree.

1 pt

1 reply

Verified: trust add only matched --name=/--note=, so the space form dropped both flags. Both forms captured now. Confirmed against the code and fixed on the v0.74 batch (verified + regression-tested); ships in station-v0.74. Thanks shweta.

Sign in to reply.