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

refactor: support outputTemplate flags for non-request based commands #369

Merged
merged 3 commits into from
May 15, 2024

Conversation

reubenmiller
Copy link
Owner

Previously commands like non-request based commands like c8y version, c8y show util etc. didn't support the global --outputTemplate flag. Now the majority of commands support output templates for a more consistent experience.

There might be some notable exceptions in the future, but in general you should be able to use --outputTemplate by default everywhere.

Example: c8y version

% c8y version --outputTemplate "{custom:{shape: output}}" | jq
{
  "custom": {
    "shape": {
      "branch": "refactor-generic-worker",
      "version": "2.40.0-SNAPSHOT-d52844df"
    }
  }
}

Example: c8y extensions list

% c8y extensions list --outputTemplate "{some:{other:output}}" | head -1 | jq
{
  "some": {
    "other": {
      "isBinary": false,
      "isLocal": false,
      "name": "defaults",
      "path": "/Users/reubenmiller/.cumulocity/extensions/c8y-defaults",
      "pinned": false,
      "repo": "reubenmiller/c8y-defaults",
      "version": "c4c17a36"
    }
  }
}

@reubenmiller reubenmiller merged commit 9d39f87 into v2 May 15, 2024
4 checks passed
@reubenmiller reubenmiller deleted the refactor-generic-worker branch May 15, 2024 06:32
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.

1 participant