Skip to content

fix: hide --input-file and --dry-run on no-input read-only commands#487

Open
margaretjgu wants to merge 1 commit into
mainfrom
fix/hide-noop-flags-readonly
Open

fix: hide --input-file and --dry-run on no-input read-only commands#487
margaretjgu wants to merge 1 commit into
mainfrom
fix/hide-noop-flags-readonly

Conversation

@margaretjgu

@margaretjgu margaretjgu commented Jul 24, 2026

Copy link
Copy Markdown
Member

Closes #378.

GET/HEAD commands with an empty input schema (e.g. es info) showed --input-file and --dry-run in --help even though both are no-ops there. defineCommand now takes a readOnly flag (set from the HTTP method in the es/kb/cloud registration layers) and skips both options when the command is read-only and its input schema has no fields.

Write commands with empty schemas keep --input-file since loose schemas pass the whole file through as the request body. GET-with-body APIs like es search keep both because their schemas have fields.

Most of the docs/cli/schema.json diff is the cloud namespace no longer promoting the two flags to namespace level, plus 64 es/kb commands losing them.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

⏳ Building and deploying preview... View progress

This comment will be updated with preview links when the build is complete.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 1.11s
✅ REPOSITORY gitleaks yes no no 58.96s
✅ REPOSITORY git_diff yes no no 0.5s
✅ REPOSITORY secretlint yes no no 30.13s
✅ REPOSITORY trivy yes no no 18.47s
✅ TYPESCRIPT eslint 6 0 0 5.68s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@margaretjgu margaretjgu changed the title Hide --input-file and --dry-run on no-input read-only commands fix: hide --input-file and --dry-run on no-input read-only commands Jul 24, 2026
@margaretjgu margaretjgu reopened this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read-only commands should not show --input-file or --dry-run options in --help output

1 participant