Skip to content

Cue commands that generate json/other files should have the option --compact #2477

@rudifa

Description

@rudifa

Is your feature request related to a problem? Please describe.
While commands def, export and eval generate indented json files, in some applications the compact (minified) json is desirable, for space and time economy.

Describe the solution you'd like
cue export data.cue --compact should produce a compact data.json file.

Describe alternatives you've considered
I can reformat the indented json file with jq or any similar tool, but getting it on demand from cue would be more efficient.

Additional context
The only mention of compact in CUE issues and in pull requests I could find is in PR #1549, suggested as a possibility by @mpvl and commented on favourably by @rogpeppe and @felixge.

While the desired effect of --compact is obvious for json, for other formats discussed in #1549 probably should be 'minify', i.e. remove anything that conveys no machine readable information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions