Skip to content

Conversation

@events555
Copy link
Contributor

Motivation

getopts in its default FloatingFrees mod treats negative RPC arguments (e.g., -1) as flags when users invoke:

tio-tool rpc <rpc-name> -1

Based on our help text, users place [rpc-arg] immediately after <rpc-name> and thus the parsing style should be changed to StopAtFirstFree. This no longer requires marking -- to stop searching for flags (shown below).

tio-tool rpc <rpc-name> -- -1
tio-tool rpc -- <rpc-name> -1

Changes

  • 71a3296 Switch tio-tool's rpc() to getopts::ParsingStyle::StopAtFirstFree so everything after <rpc-name> is treated as free (fixes negative args without requiring --).
  • 070ebed Use util::default_proxy_url() as the actual fallback for -r
  • c7f5966 Correct 64-bit request serialization (was previously using 32 bit types)
  • 9fcf676 Change help text to --rep-type (not --ret-type)

How to Test

Verify tio-tool works on negative arguments

  • tio-tool rpc field.cutoff -1

Also verify manual type specification of a RPC reply with -T/--rep-type

@events555 events555 requested a review from tkornack October 1, 2025 17:41
@events555 events555 added the bug Something isn't working label Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants