SpacetimeDB
SpacetimeDB copied to clipboard
Improve `spacetime call` diagnostics for invalid / ill-typed arguments
Today (2024-04-10), I (pgoldman) had to hop into a call with the BitCraft team to explain the correct syntax to call a reducer which took a C-style enum as an argument via the CLI. Ideally, the CLI error message should have given them enough information to determine a correct call on their own. Consider:
- Changing the CLI's parsing to accept strings for C-style enums (They were trying to pass
"Admin", when the correct parse was{ "Admin": {} }, which is a stupid and unintuitive format). - Printing a sample invocation which will parse correctly.
- Linking the docs for the JSON format used by the CLI.
We could accept both the old and new format and therefore not be api-breaking.