package csexp-query
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Query tool for canonical s-expressions
Install
dune-project
Dependency
Authors
Maintainers
Sources
csexp-query-0.1.0.tbz
sha256=5e42f84c168b58adc71a5e79c9d388da077b1c88b6b4489d3ae065cfcd458835
sha512=1d08b5491856d05347125fa32d56200e0ca97d1a4c7b6e3164a85817dca858c27cf401b2c1f7f7d02632c38a95ab1ed37721373485b202e210dfdf41703f6178
doc/README.html
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
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page