aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-10-02 06:33:41 +0200
committerOnur Gündüz <ogunduz@gmail.com>2026-10-02 06:33:41 +0200
commitd74582678e03a5a47d1dbe8a319739de36a42162 (patch)
tree19e009ac7a6ee8fe410ac386a51ec86a024a2904
parentb4b95a173230ce2b836be0cff064bdb6a67d0076 (diff)
downloadele-d74582678e03a5a47d1dbe8a319739de36a42162.tar.gz
ele-d74582678e03a5a47d1dbe8a319739de36a42162.zip
Rename crate and CLI to ele
-rw-r--r--.github/workflows/release.yml28
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml8
-rw-r--r--LICENSE2
-rw-r--r--README.md16
-rw-r--r--scripts/release.py6
-rw-r--r--scripts/test_release.py2
-rw-r--r--src/compiled.rs2
-rw-r--r--src/eval.rs2
-rw-r--r--src/lib.rs4
-rw-r--r--src/main.rs4
-rw-r--r--tests/cli_tests.rs22
-rw-r--r--tests/compiled_tests.rs10
-rw-r--r--tests/eval_tests.rs2
-rw-r--r--tests/has_path_tests.rs2
-rw-r--r--tests/json_number_tests.rs2
-rw-r--r--tests/limit_tests.rs4
-rw-r--r--tests/parse_tests.rs2
18 files changed, 60 insertions, 60 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 3f44f40..7f58703 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -82,13 +82,13 @@ jobs:
include:
- os: ubuntu-24.04
target: x86_64-unknown-linux-musl
- binary: aif
+ binary: ele
- os: macos-15
target: aarch64-apple-darwin
- binary: aif
+ binary: ele
- os: windows-latest
target: x86_64-pc-windows-msvc
- binary: aif.exe
+ binary: ele.exe
env:
TARGET: ${{ matrix.target }}
BINARY: ${{ matrix.binary }}
@@ -123,14 +123,14 @@ jobs:
run: |
cargo build --release --locked --target "$TARGET"
binary="target/$TARGET/release/$BINARY"
- test "$("$binary" --version)" = "aif $VERSION"
+ test "$("$binary" --version)" = "ele $VERSION"
printf '{"n":1}\n{"n":2}\n' | "$binary" 'n > 1' > target/smoke.jsonl
printf '{"n":2}\n' > target/expected.jsonl
cmp target/expected.jsonl target/smoke.jsonl
- name: Verify static Linux executable
if: runner.os == 'Linux'
run: |
- readelf -l "target/$TARGET/release/aif" > target/elf-headers
+ readelf -l "target/$TARGET/release/ele" > target/elf-headers
if grep -q INTERP target/elf-headers; then
echo 'The Linux executable requires a dynamic loader.' >&2
exit 1
@@ -139,20 +139,20 @@ jobs:
if: runner.os != 'Windows'
run: |
mkdir -p target/release-dist
- COPYFILE_DISABLE=1 tar -czf "target/release-dist/aif-v$VERSION-$TARGET.tar.gz" \
- -C "target/$TARGET/release" aif -C "$GITHUB_WORKSPACE" LICENSE README.md
+ COPYFILE_DISABLE=1 tar -czf "target/release-dist/ele-v$VERSION-$TARGET.tar.gz" \
+ -C "target/$TARGET/release" ele -C "$GITHUB_WORKSPACE" LICENSE README.md
- name: Archive Windows CLI
if: runner.os == 'Windows'
run: |
mkdir -p target/release-dist
- python -m zipfile -c "target/release-dist/aif-v$VERSION-$TARGET.zip" \
+ python -m zipfile -c "target/release-dist/ele-v$VERSION-$TARGET.zip" \
"target/$TARGET/release/$BINARY" LICENSE README.md
- name: Verify library package
if: runner.os == 'Linux'
run: |
cargo package --locked
- cargo test --locked --manifest-path "target/package/aif-$VERSION/Cargo.toml"
- cp "target/package/aif-$VERSION.crate" target/release-dist/
+ cargo test --locked --manifest-path "target/package/ele-$VERSION/Cargo.toml"
+ cp "target/package/ele-$VERSION.crate" target/release-dist/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: release-assets-${{ matrix.target }}
@@ -194,10 +194,10 @@ jobs:
path: target/release-dist
- name: Verify asset set and generate checksums
run: |
- test -f "target/release-dist/aif-v$VERSION-x86_64-unknown-linux-musl.tar.gz"
- test -f "target/release-dist/aif-v$VERSION-aarch64-apple-darwin.tar.gz"
- test -f "target/release-dist/aif-v$VERSION-x86_64-pc-windows-msvc.zip"
- test -f "target/release-dist/aif-$VERSION.crate"
+ test -f "target/release-dist/ele-v$VERSION-x86_64-unknown-linux-musl.tar.gz"
+ test -f "target/release-dist/ele-v$VERSION-aarch64-apple-darwin.tar.gz"
+ test -f "target/release-dist/ele-v$VERSION-x86_64-pc-windows-msvc.zip"
+ test -f "target/release-dist/ele-$VERSION.crate"
test "$(find target/release-dist -maxdepth 1 -type f | wc -l)" -eq 4
cd target/release-dist
sha256sum *.tar.gz *.zip *.crate > SHA256SUMS
diff --git a/Cargo.lock b/Cargo.lock
index a0588a0..a0d3e63 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12,7 +12,7 @@ dependencies = [
]
[[package]]
-name = "aif"
+name = "ele"
version = "0.1.0"
dependencies = [
"regex",
diff --git a/Cargo.toml b/Cargo.toml
index 5fa61c4..e79f684 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,12 +1,12 @@
[package]
-name = "aif"
+name = "ele"
version = "0.1.0"
edition = "2024"
rust-version = "1.88"
license = "MIT"
description = "AIP-160-style filtering for Rust values and newline-delimited JSON"
-repository = "https://github.com/tetsuo/aif"
-documentation = "https://docs.rs/aif"
+repository = "https://github.com/tetsuo/ele"
+documentation = "https://docs.rs/ele"
readme = "README.md"
keywords = ["aip-160", "filter", "json", "cli"]
categories = ["command-line-utilities", "parser-implementations"]
@@ -23,5 +23,5 @@ panic = "abort"
strip = true
[[bin]]
-name = "aif"
+name = "ele"
path = "src/main.rs"
diff --git a/LICENSE b/LICENSE
index 0d633aa..6c15859 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2026 aif contributors
+Copyright (c) 2026 ele contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 505e82f..d52b9ef 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# aif
+# ele
Parses and evaluates an [AIP-160](https://google.aip.dev/160)-style filter language for JSON and Rust values.
@@ -16,15 +16,15 @@ cargo +stable install --path . --locked
The CLI reads one JSON value per line from files or standard input and prints matching records without reformatting.
```text
-aif [-p|--print] [--max-record-bytes N] [--] <expr> [file...]
+ele [-p|--print] [--max-record-bytes N] [--] <expr> [file...]
```
```bash
-echo '{"price":93,"status":"active"}' | aif 'price > 10 AND status = active'
+echo '{"price":93,"status":"active"}' | ele 'price > 10 AND status = active'
-aif '"timeout"' events.jsonl
-aif 'tags:beta' events.jsonl
-aif 'user.settings.theme = dark' events.jsonl
+ele '"timeout"' events.jsonl
+ele 'tags:beta' events.jsonl
+ele 'user.settings.theme = dark' events.jsonl
```
* `--print` prints the parsed expression instead of filtering input.
@@ -50,7 +50,7 @@ Function calls are not supported during evaluation.
Compile an expression once and reuse the filter. `serde_json::Value` is supported directly; implement `Filterable` for other types.
```rust
-use aif::parse;
+use ele::parse;
use serde_json::json;
let expr = parse("state = open AND priority > 3").unwrap().unwrap();
@@ -63,7 +63,7 @@ assert!(filter.evaluate(&record));
For a custom type, expose its fields through `Filterable`:
```rust
-use aif::{Filterable, Value, parse};
+use ele::{Filterable, Value, parse};
struct Issue {
state: String,
diff --git a/scripts/release.py b/scripts/release.py
index e607c79..9ee1e80 100644
--- a/scripts/release.py
+++ b/scripts/release.py
@@ -50,8 +50,8 @@ def set_version(version):
manifest = Path("Cargo.toml")
text = manifest.read_text()
package = tomllib.loads(text)["package"]
- if package["name"] != "aif":
- raise ValueError("expected the aif package")
+ if package["name"] != "ele":
+ raise ValueError("expected the ele package")
current = package["version"]
if version_tuple(current) > version_tuple(version):
raise ValueError(f"manifest version {current} exceeds the planned release {version}")
@@ -64,7 +64,7 @@ def set_version(version):
if count != 1:
raise ValueError("expected one explicit package version")
expected_lock = copy.deepcopy(tomllib.loads(Path("Cargo.lock").read_text()))
- packages = [p for p in expected_lock["package"] if p["name"] == "aif" and "source" not in p]
+ packages = [p for p in expected_lock["package"] if p["name"] == "ele" and "source" not in p]
if len(packages) != 1 or packages[0]["version"] != current:
raise ValueError("manifest and lockfile versions must agree")
packages[0]["version"] = version
diff --git a/scripts/test_release.py b/scripts/test_release.py
index b3f1deb..8718544 100644
--- a/scripts/test_release.py
+++ b/scripts/test_release.py
@@ -48,7 +48,7 @@ class RepositoryTests(unittest.TestCase):
release.run("git", "config", "commit.gpgsign", "false")
Path(".gitignore").write_text("target/\n")
Path("Cargo.toml").write_text(
- '[package]\nname = "aif"\nversion = "0.1.0"\nedition = "2024"\n'
+ '[package]\nname = "ele"\nversion = "0.1.0"\nedition = "2024"\n'
)
Path("src").mkdir()
Path("src/lib.rs").write_text("pub fn example() {}\n")
diff --git a/src/compiled.rs b/src/compiled.rs
index 3bc238c..c046e3d 100644
--- a/src/compiled.rs
+++ b/src/compiled.rs
@@ -6,7 +6,7 @@ use std::borrow::Cow;
/// A validated filter with reusable regexes, literals, and field paths.
///
/// ```
-/// use aif::parse;
+/// use ele::parse;
/// use serde_json::json;
///
/// let expr = parse(r#"state =~ "^op" AND priority < 6"#).unwrap().unwrap();
diff --git a/src/eval.rs b/src/eval.rs
index 30fd19d..f3692ee 100644
--- a/src/eval.rs
+++ b/src/eval.rs
@@ -119,7 +119,7 @@ fn compare_integer_float(integer: i128, float: f64) -> Option<Ordering> {
/// # Example
///
/// ```rust
-/// use aif::{Value, Filterable};
+/// use ele::{Value, Filterable};
///
/// struct Issue {
/// state: String,
diff --git a/src/lib.rs b/src/lib.rs
index 4839de2..5a896b9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,7 +3,7 @@
//! ## Example
//!
//! ```rust
-//! use aif::{parse, Value, Filterable};
+//! use ele::{parse, Value, Filterable};
//!
//! let expr = parse("state = \"open\" AND priority > 3").unwrap().unwrap();
//! println!("{}", expr);
@@ -14,7 +14,7 @@
//! Implement [`Filterable`] for your type, then call [`Expr::evaluate`]:
//!
//! ```rust
-//! use aif::{parse, Value, Filterable};
+//! use ele::{parse, Value, Filterable};
//!
//! struct Issue {
//! state: String,
diff --git a/src/main.rs b/src/main.rs
index f763794..4a1c9d8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,4 @@
-use aif::{CompiledFilter, parse};
+use ele::{CompiledFilter, parse};
use serde_json::Value as Json;
use std::{
fs::File,
@@ -116,7 +116,7 @@ fn main() {
);
}
"-V" | "--version" => {
- return print_info(&program, concat!("aif ", env!("CARGO_PKG_VERSION")));
+ return print_info(&program, concat!("ele ", env!("CARGO_PKG_VERSION")));
}
_ if arg.starts_with("--") => {
eprintln!("{program}: unknown option: {arg}; use -- before a literal expression");
diff --git a/tests/cli_tests.rs b/tests/cli_tests.rs
index ca817ed..6485d4c 100644
--- a/tests/cli_tests.rs
+++ b/tests/cli_tests.rs
@@ -6,7 +6,7 @@ fn run(expr: &str, input: &str, args: &[&str]) -> Output {
}
fn run_bytes(expr: &str, input: &[u8], args: &[&str]) -> Output {
- let mut child = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let mut child = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(args)
.arg(expr)
.stdin(Stdio::piped())
@@ -139,7 +139,7 @@ fn empty_filter_and_print_mode() {
let output = run("", input, &[]);
assert!(output.status.success());
assert_eq!(output.stdout, input.as_bytes());
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["--print", ""])
.stdin(Stdio::null())
.output()
@@ -148,7 +148,7 @@ fn empty_filter_and_print_mode() {
assert!(output.stdout.is_empty());
let path = format!("{}/README.md", env!("CARGO_MANIFEST_DIR"));
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["", &path])
.stdin(Stdio::null())
.output()
@@ -160,7 +160,7 @@ fn empty_filter_and_print_mode() {
#[test]
fn information_flags_succeed_and_unknown_long_options_fail() {
for flag in ["--help", "-h", "--version", "-V"] {
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(flag)
.stdin(Stdio::null())
.output()
@@ -173,11 +173,11 @@ fn information_flags_succeed_and_unknown_long_options_fail() {
assert!(text.contains("--max-record-bytes"));
assert!(text.contains("--version"));
} else {
- assert_eq!(text, format!("aif {}\n", env!("CARGO_PKG_VERSION")));
+ assert_eq!(text, format!("ele {}\n", env!("CARGO_PKG_VERSION")));
}
}
for flag in ["--verison", "--unknown", "--print=invalid"] {
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(flag)
.stdin(Stdio::null())
.output()
@@ -271,7 +271,7 @@ fn filtering_multiple_files_preserves_successful_output() {
let second = dir.join("second.jsonl");
std::fs::write(&first, b"\"match first\"\n").unwrap();
std::fs::write(&second, b"invalid\n\"match second\"\n").unwrap();
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("match")
.arg(&first)
.arg(&second)
@@ -296,7 +296,7 @@ fn multiple_files_keep_record_boundaries_without_forcing_a_final_newline() {
for ending in ["", "\n", "\r\n"] {
std::fs::write(&first, format!("\"match first\"{ending}")).unwrap();
std::fs::write(&last, b"\"match last\"").unwrap();
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("match")
.args([&first, &middle, &last])
.output()
@@ -315,7 +315,7 @@ fn multiple_files_keep_record_boundaries_without_forcing_a_final_newline() {
}
std::fs::write(&first, b"raw").unwrap();
std::fs::write(&last, b"bytes").unwrap();
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("")
.args([&first, &last])
.output()
@@ -332,7 +332,7 @@ fn output_flush_errors_are_reported() {
use std::os::unix::net::UnixStream;
let (writer, reader) = UnixStream::pair().unwrap();
drop(reader);
- let mut child = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let mut child = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg("foobar")
.stdin(Stdio::piped())
.stdout(Stdio::from(OwnedFd::from(writer)))
@@ -349,7 +349,7 @@ fn output_flush_errors_are_reported() {
for flag in ["--help", "--version"] {
let (writer, reader) = UnixStream::pair().unwrap();
drop(reader);
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(flag)
.stdin(Stdio::null())
.stdout(Stdio::from(OwnedFd::from(writer)))
diff --git a/tests/compiled_tests.rs b/tests/compiled_tests.rs
index 56059c5..c8c9be7 100644
--- a/tests/compiled_tests.rs
+++ b/tests/compiled_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Expr, Filterable, Value, parse};
+use ele::{Expr, Filterable, Value, parse};
use serde_json::json;
use std::process::{Command, Stdio};
@@ -21,7 +21,7 @@ fn unsupported_functions_reject_the_entire_filter() {
.contains("function calls are not supported")
);
assert!(!expr.evaluate(&record), "{input}");
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.arg(input)
.stdin(Stdio::null())
.output()
@@ -32,7 +32,7 @@ fn unsupported_functions_reject_the_entire_filter() {
String::from_utf8_lossy(&output.stderr).contains("function calls are not supported")
);
}
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["--print", "fn(x)"])
.output()
.unwrap();
@@ -131,9 +131,9 @@ fn regex_resources_and_manual_trees_are_bounded() {
let mut expr = parse("value").unwrap().unwrap();
for _ in 0..150 {
expr = Expr::Unary {
- op: aif::UnaryOp::Not,
+ op: ele::UnaryOp::Not,
expr: Box::new(expr),
- pos: aif::Position { line: 1, col: 1 },
+ pos: ele::Position { line: 1, col: 1 },
};
}
assert!(expr.compile().unwrap_err().contains("expression limit"));
diff --git a/tests/eval_tests.rs b/tests/eval_tests.rs
index ae3edec..7fb901d 100644
--- a/tests/eval_tests.rs
+++ b/tests/eval_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Filterable, Value, parse};
+use ele::{Filterable, Value, parse};
struct Record<'a> {
value: Value<'a>,
diff --git a/tests/has_path_tests.rs b/tests/has_path_tests.rs
index 281a8e6..5d74768 100644
--- a/tests/has_path_tests.rs
+++ b/tests/has_path_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Filterable, Value, parse};
+use ele::{Filterable, Value, parse};
use serde_json::json;
fn matches(record: &impl Filterable, text: &str) -> bool {
diff --git a/tests/json_number_tests.rs b/tests/json_number_tests.rs
index 0a0662d..e81080c 100644
--- a/tests/json_number_tests.rs
+++ b/tests/json_number_tests.rs
@@ -1,4 +1,4 @@
-use aif::{Filterable, Value, parse};
+use ele::{Filterable, Value, parse};
use serde_json::{Number, Value as Json};
#[test]
diff --git a/tests/limit_tests.rs b/tests/limit_tests.rs
index b3f6575..43f734e 100644
--- a/tests/limit_tests.rs
+++ b/tests/limit_tests.rs
@@ -1,4 +1,4 @@
-use aif::{parse, parser::MAX_FILTER_BYTES};
+use ele::{parse, parser::MAX_FILTER_BYTES};
use std::process::Command;
#[test]
@@ -16,7 +16,7 @@ fn excessive_filters_report_errors_without_crashing() {
"界".repeat(MAX_FILTER_BYTES / "界".len() + 1),
];
for filter in filters {
- let output = Command::new(env!("CARGO_BIN_EXE_aif"))
+ let output = Command::new(env!("CARGO_BIN_EXE_ele"))
.args(["--print", &filter])
.output()
.unwrap();
diff --git a/tests/parse_tests.rs b/tests/parse_tests.rs
index 40a3879..b032c1e 100644
--- a/tests/parse_tests.rs
+++ b/tests/parse_tests.rs
@@ -1,4 +1,4 @@
-use aif::parse;
+use ele::parse;
use std::collections::HashSet;
use std::fs;
use std::path::Path;