Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement || selector #5

Open
jihchi opened this issue Oct 19, 2021 · 0 comments
Open

Implement || selector #5

jihchi opened this issue Oct 19, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@jihchi
Copy link
Owner

jihchi commented Oct 19, 2021

Reference: https://github.com/kdl-org/kdl/blob/1.0.0/QUERY-SPEC.md#selectors

a b || a c: Selects all b and c elements that are descendants of an a element. Any selector may be on either side of the ||. Multiple || are supported.

For example:

$ cat example.kdl
package {
    name "foo"
    version "1.0.0"
    dependencies platform="windows" {
        winapi "1.0.0" path="./crates/my-winapi-fork"
    }
    dependencies {
        miette "2.0.0" dev=true
    }
}

$ cat example.kdl | kq "package author || package version"
version "1.0.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant