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
I quite often want to confirm the existence or absence of certain data in a file. For that purpse, I use yq --exit-status to convey that information. When using that flag, it is most commonly the only output I require. So I end up writing yq --exit-status ... &> /dev/null to throw away the extraneous output. It would be convenient if I didn't have to work around the unwanted output from the CLI and I could explicitly suppress it instead.
Just as an example:
functioncontains-key {
yq --exit-status "$1""$2"&> /dev/null
}
if contains-key '.catpants''my/file.txt';then# do the needfulfi
Describe the solution you'd like
I'd like to see a new flag that doesn't require work arounds to keep the console/output clean.
A few implementation thoughts:
Additional flags to be combined with --exit-status:
--quiet
--silent
--suppress-output - a bit more verbose but very explicit
A different approach - an alternate (replacement?) flag:
--exit-status-only
This could theoretically allow you to deprecate --exit-status in favor of this one. I'm honestly not sure if people are using both outputs at once. Or it could simply be remain a nice alternative.
Additional context
With this option, there'd be no need to pipe output to /dev/null. For reference, this is similar to the grep option:
✗ grep --help | grep quiet
-q, --quiet, --silent suppress all normal output
The text was updated successfully, but these errors were encountered:
Please describe your feature request.
I quite often want to confirm the existence or absence of certain data in a file. For that purpse, I use
yq --exit-status
to convey that information. When using that flag, it is most commonly the only output I require. So I end up writingyq --exit-status ... &> /dev/null
to throw away the extraneous output. It would be convenient if I didn't have to work around the unwanted output from the CLI and I could explicitly suppress it instead.Just as an example:
Describe the solution you'd like
I'd like to see a new flag that doesn't require work arounds to keep the console/output clean.
A few implementation thoughts:
Additional flags to be combined with
--exit-status
:--quiet
--silent
--suppress-output
- a bit more verbose but very explicitA different approach - an alternate (replacement?) flag:
--exit-status-only
This could theoretically allow you to deprecate
--exit-status
in favor of this one. I'm honestly not sure if people are using both outputs at once. Or it could simply be remain a nice alternative.Additional context
With this option, there'd be no need to pipe output to
/dev/null
. For reference, this is similar to thegrep
option:✗ grep --help | grep quiet -q, --quiet, --silent suppress all normal output
The text was updated successfully, but these errors were encountered: