Skip to content

Option to set exit status code when query doesn't yield any results #189

Description

@Yv-vY

Problem Statement

There's currently no programmatic way of testing if a node has been found.

It would be nice to add an option (maybe -s) so xq return an exit status code depending on wether a node has been found or not, à la grep.

Expected Result

> echo '<?xml version="1.0"?><root></root>' | xq -s -q none
> echo $?
1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions