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
Please describe your feature request.
Greetings! 👋
Would it be possible to add support for comments inside of filters, i.e. a way to document more complex filters? I'm writing a fairly complicated filter for use inside of a bash script and I would like to write some documentation inside of the filter for each step of the filter so that the future maintainer (i.e. probably me) will understand what's going on. 😅
Describe the solution you'd like
I'd like it to be possible to define a filter across multiple lines, and have lines that start with # be considered as comments and ignored until the end of the line.
In bash I'm imaging that it could be used something like this - first defining the filter:
filter=$(cat <<'EOF'# Pretend that this is a comment for a very complex filter.EOF)
And then could be invoked thusly:
yq "$filter" file.yaml
Currently, however, this just prints an error: Error: 1:1: invalid input text "# Comment here..."
Describe alternatives you've considered
N/A
Additional context
This is supported nicely in jq and it would be nice to have this feature here too!
The text was updated successfully, but these errors were encountered:
Please describe your feature request.
Greetings! 👋
Would it be possible to add support for comments inside of filters, i.e. a way to document more complex filters? I'm writing a fairly complicated filter for use inside of a
bash
script and I would like to write some documentation inside of the filter for each step of the filter so that the future maintainer (i.e. probably me) will understand what's going on. 😅Describe the solution you'd like
I'd like it to be possible to define a filter across multiple lines, and have lines that start with
#
be considered as comments and ignored until the end of the line.In
bash
I'm imaging that it could be used something like this - first defining the filter:And then could be invoked thusly:
yq "$filter" file.yaml
Currently, however, this just prints an error:
Error: 1:1: invalid input text "# Comment here..."
Describe alternatives you've considered
N/A
Additional context
This is supported nicely in
jq
and it would be nice to have this feature here too!The text was updated successfully, but these errors were encountered: