package csexp-query
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=5e42f84c168b58adc71a5e79c9d388da077b1c88b6b4489d3ae065cfcd458835
sha512=1d08b5491856d05347125fa32d56200e0ca97d1a4c7b6e3164a85817dca858c27cf401b2c1f7f7d02632c38a95ab1ed37721373485b202e210dfdf41703f6178
Description
A minimal CLI tool to query csexp input using sexp-compatible query syntax.
Added to opam-repository:
README
csexp-query
A minimal command-line tool to query canonical s-expressions (csexp) from stdin.
Installation
opam install csexp-queryUsage
csexp-query QUERYReads a csexp s-expression from stdin, applies the query, and outputs results (one csexp per line).
Query Operations
Operation | Syntax | Description |
|---|---|---|
field |
| Find |
index |
| Get Nth element (0-indexed, negative supported) |
each |
| Iterate over list elements |
pipe |
| Sequential composition |
cat |
| Concatenate results of independent queries |
this |
| Identity |
Multiple top-level expressions are implicitly piped.
Examples
# Get a field value
dune describe --format=csexp | csexp-query '(field name)'
# Get the first element
dune describe --format=csexp | csexp-query '(index 0)'
# Iterate over a list field
dune describe --format=csexp | csexp-query '(field modules) each'
# Get multiple fields
dune describe --format=csexp | csexp-query '(cat (field name) (field version))'
# Chain operations
dune describe --format=csexp | csexp-query '(index 0) (field name)'Query Syntax
The query syntax is compatible with a subset of sexp.
Exit Codes
- 0: Success (including empty result)
- 1: Parse error or query error
Dependencies (4)
- dune-build-info
- csexp
- dune
-
ocaml
>= "4.13.0"
Dev Dependencies (1)
-
ppx_expect
with-test
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building csexp-query with each compiler on check.ci.ocaml.org, run of against opam-repository 6e2873f. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.0 (this version) | n/a | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure