This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
cmd/cue: allow export
ing one expression only
#240
Labels
export
ing one expression only
#240
With
cue eval
, we get the option-e
to evaluate one expression (path) only.It would be useful to get the same option for the
export
command.Use case
When applying k8s configs to a cluster, I often want to apply specific deployments at a time.
I use the
export
command to get the output in a format kubernetes understands (json for now).But I need to be able to export an expression/path of my configs at a time.
So I end up using both
eval
to get one expression only, thenexport
to transform to json.But I wish to be able to do that in one command (no temp file needed).
Potential solutions (not working for now)
Add a
-e
flag to theexport
command, which would work the same way as the one for theeval
command:cue export -e deployments.dep1 manyDeps.cue
Allow
cue export
to work with more files than just files named*.cue
This could allow using file descriptors as input (and process substitution):
cue export <(cue eval -e deployments.dep1 manyDeps.cue)
Still work with files with different names than
*.cue
, but the user needs to be explicit about it.For instance using
-f
as a flag to select the input file:cue export -f deps.notcue
and adapted to my case:
cue export -f <(cue eval -e deployments.dep1 manyDeps.cue)
Allow input from stdin instead of files.
Some tools use the
-f -
syntax:commandThatProducesCue | cue export -f -
and adapted to my case:
cue eval -e deployments.dep1 manyDeps.cue | cue export -f -
I would favour number 1, as it seems closest to what is already there in the tool (adds less to learn).
Any other opinions ? About this problem (is it worth solving) ? And any of these or other possible solutions ?
Or any strong reasons to not do any of this ?
The text was updated successfully, but these errors were encountered: