Reproduction steps:
- In railcall_cli.py, read _market_publish()'s early-detection helper
(~line 5829-5833):
def _peek_flag(name, default=None):
for a in args[1:]:
if a.startswith("--" + name + "="):
return a[len(name) + 3:]
return default
if _peek_flag("type") == "module":
return _market_publish_module(args)
- Call the isolated equivalent with args = ["/path/to/module_dir",
"--type", "module"] (space form).
- Call it with args = ["/path/to/module_dir", "--type=module"] (equals
form).
Expected: railcall market publish <module_dir> --type module should
route to _market_publish_module(), the directory-based module publish
path, regardless of which flag form is used -- this same CLI accepts both
forms for other flags (the flag() helper, --template/--dest elsewhere).
Actual:
space form -> None (only routes to the module publisher when this equals 'module')
equals form-> module
With the space form, _peek_flag("type") returns the default (None), so the
"== 'module'" check fails and _market_publish_module() is never called.
Execution instead falls through to the JSON-spec-file publish path and
tries to open the module directory as a spec_path -- a directory, not a
file -- producing a confusing failure unrelated to the actual mistake (a
flag that was silently not recognized).
Root cause: railcall_cli.py, _market_publish()'s _peek_flag() (~line
5829-5833). Only recognizes --name=value; no branch for a == "--" + name
followed by consuming the next token.
Suggested fix: give _peek_flag() the same two-form parsing the shared
flag() helper already uses elsewhere in this file.