Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: provide better raw output handling #16

Merged
merged 5 commits into from
Apr 17, 2024
Merged

Conversation

fabio-nettis
Copy link
Member

@fabio-nettis fabio-nettis commented Apr 17, 2024

Description

This PR adds better handling for the --raw output flag when used on deeply nested results.

We also added a --pretty flag that can be used in combination with --raw to indent. and properly space out the printed json. Here is an example:

hellhub planets --include="sector" --filters="name:@contains:creek" --raw --pretty
[
 {
  "id": 197,
  "index": 196,
  // ... (properties ommited)
  "sector": {
   "id": 42,
   "index": 42,
   "name": "Severin",
   "createdAt": "2024-04-17T09:36:06.069Z",
   "updatedAt": "2024-04-17T13:57:02.665Z"
  }
 }
]

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@fabio-nettis fabio-nettis added the enhancement New feature or request label Apr 17, 2024
Copy link

Thank you for contributing to the HellHub CLI fellow Helldiver! We try to keep our bundle size as small as possible, here you can see the impact of your pull request to the main bundle.

📦 Main 🚀 PR 📁 Generated Files
140 kB 140 kB index.mjs / index.d.ts

The difference between the current bundle and the one generated for your pull request is: 0 kB. Keep in mind that this is just an estimation and the actual difference might be smaller due to compression.

@fabio-nettis fabio-nettis merged commit c5277ee into main Apr 17, 2024
4 checks passed
@fabio-nettis fabio-nettis deleted the feat/output-raw branch April 17, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant