Skip to content

fix: human-readable text output for simple commands#419

Open
margaretjgu wants to merge 3 commits into
mainfrom
fix/human-readable-output
Open

fix: human-readable text output for simple commands#419
margaretjgu wants to merge 3 commits into
mainfrom
fix/human-readable-output

Conversation

@margaretjgu

Copy link
Copy Markdown
Member

Summary

Closes #379

  • elastic version now prints 0.2.1 instead of { "version": "0.2.1" } — bare string, easy to pipe
  • elastic config context list now prints a * current / other bullet list instead of JSON
  • elastic config context add/edit/remove now prints Context '<name>' added/updated/removed. plus any warnings
  • elastic config current-context get now prints just the context name
  • elastic config current-context set now prints Switched to context '<name>'. plus any warnings
  • renderText now renders single flat objects as key: value lines instead of falling through to JSON.stringify, which improves all extension commands (extension install, extension remove, etc.) for free
  • --json output is unchanged throughout; all config integration tests pass using --json

Test plan

  • npx tsc --noEmit passes
  • npx tsx --test test/output.test.ts test/factory.test.ts — 313 tests, 0 failures
  • Manually verify: elastic version, elastic config context list, elastic config context add, elastic config current-context get/set

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ COPYPASTE jscpd yes no no 7.02s
✅ REPOSITORY gitleaks yes no no 63.19s
✅ REPOSITORY git_diff yes no no 0.54s
✅ REPOSITORY secretlint yes no no 32.89s
✅ REPOSITORY trivy yes no no 18.0s
✅ TYPESCRIPT eslint 5 0 0 4.43s

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

@JoshMock JoshMock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

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.

Make return values more readable by default

2 participants