You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The former breaks in user shells that do not respect C escape syntax conventions, such as Windows PowerShell.
The latter breaks in user shells that do not respect single quoted strings, like Windows Command Prompt.
While there are technically some sh interpreter shims available, such as WSL, I would prefer that my command line tools be able to operate well without assuming a particular user environment. Windows is just one example.
I have no idea how the commands would behave when run on FreeBSD, where the default shell isn't even a POSIX compliant one, but csh/tcsh. I have no idea how the commands would behave on still other shells like fish, ion, rc, legacy ksh, or the vintage Thompson sh.
Our immediate problem is the fact that style's value syntax requires double quotes, which are hard to wrap in the larger yq query CLI argument in a portable way.
Describe the solution you'd like
I would love for -r and --raw to behave like jq. But I'd settle for supporting style=blank, or failing that, style=''.
This will be fixed once I add a toml encoder, which I plan on working soon., What I couild do first is add a toml encoder that only encodes scalar values (like above).
Only caveat is that this first cut would error if its encoding a map or array until that functionality is added.
Please describe your feature request.
The current way to obtain raw string output text involves specifying
style=""
:yq -o yaml ".target | keys | .[] | . style=\"\"" Cross.toml
or
yq -o yaml '.target | keys | .[] | . style=""' Cross.toml
The former breaks in user shells that do not respect C escape syntax conventions, such as Windows PowerShell.
The latter breaks in user shells that do not respect single quoted strings, like Windows Command Prompt.
While there are technically some
sh
interpreter shims available, such as WSL, I would prefer that my command line tools be able to operate well without assuming a particular user environment. Windows is just one example.I have no idea how the commands would behave when run on FreeBSD, where the default shell isn't even a POSIX compliant one, but csh/tcsh. I have no idea how the commands would behave on still other shells like fish, ion, rc, legacy ksh, or the vintage Thompson sh.
Our immediate problem is the fact that
style
's value syntax requires double quotes, which are hard to wrap in the larger yq query CLI argument in a portable way.Describe the solution you'd like
I would love for
-r
and--raw
to behave like jq. But I'd settle for supportingstyle=blank
, or failing that,style=''
.And we run a command:
yq -r ".target | keys | .[]" Cross.toml
or
yq -o yaml ".target | keys | .[] style=blank" Cross.toml
or
yq -o yaml ".target | keys | .[] style=''" Cross.toml
it could output
The text was updated successfully, but these errors were encountered: