Skip to content

Commit b662356

Browse files
committed
fix(cli): stop a page-size default capping a destructive filter
Every request field named limit inherited the pager's default of 100, but only a cursor-paginated command interprets that flag. The two filter-based row mutations declare no cursor, so the default went onto the wire as a row cap: a filter matching 250 rows deleted 100, exited 0, and said nothing - while the confirmation the user had just answered promised every matching row. The flag's own help offered 0 for everything, which those endpoints reject; the unbounded form is the field being absent. The pager's default now applies only where the pager runs, and the tests pin the omission on the request body rather than in help text. A cap typed alongside an explicit row list was silently ignored; it is now refused on the client, where refusing costs nothing to already-installed versions. Lists also truncated at a hundred with no signal in any format, and the two inventory endpoints that do report truncation had that field dropped on the way out - so a caller reconciling against a clipped list could not tell. One note now goes to stderr while stdout stays a bare array, and a flag raised on a later page survives the fold. Also: a folder whose name contains the separator no longer prints a path that resolves to a different folder; validation errors name the flag the user typed instead of the wire field; an unknown subcommand with --help exits non-zero instead of printing the parent's help; a fractional or negative page size is refused rather than floored; an empty query filter is refused rather than silently returning everything; and the two spellings of the missing-workspace message became one.
1 parent bd35b81 commit b662356

13 files changed

Lines changed: 1109 additions & 40 deletions

File tree

packages/sim-cli/src/program.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import { attachCredentialCommands } from './commands/credentials'
55
import { attachProtocolCommands } from './commands/protocol/index'
66
import { attachSecretCommands } from './commands/secrets'
77
import { OUTPUT_FORMATS } from './config/index'
8-
import { assertNoReservedProgramFlags, buildGeneratedCommands } from './runtime/build'
8+
import {
9+
assertNoReservedProgramFlags,
10+
buildGeneratedCommands,
11+
refuseHelpAfterUnknownCommand,
12+
} from './runtime/build'
913
import { CLI_VERSION } from './version'
1014

1115
/** Root program description, shared by `--help` and the generated docs. */
@@ -145,6 +149,7 @@ export function buildProgram(options: { version?: boolean } = {}): Command {
145149

146150
program.addHelpText('after', HELP_EPILOGUE)
147151

152+
refuseHelpAfterUnknownCommand(program)
148153
assertNoReservedProgramFlags(program)
149154

150155
return program

0 commit comments

Comments
 (0)