Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,26 @@ cirup --help

## Global options

- `-v`, `-vv`, ...: increase log verbosity.
- `--output-format <jsonl|json|table>`: control stdout format. Default is `jsonl`.
- `--dry-run`: compute results without writing output files. If a command normally writes to a file, the result is rendered to stdout instead.
- `--check`: imply `--dry-run` and exit with code `2` when the command would produce changes.
- `--summary`: print a structured execution summary instead of full result rows. Combine it with `--dry-run` for inspect-only workflows.
- `--count-only`: print only the number of matching results to stdout.
- `--key-filter <pattern>`: keep only results whose key matches a simple regex-style pattern. Repeatable. Supported syntax: literals, `^`, `$`, `.`, and `.*`.
- `--value-filter <pattern>`: keep only results whose value matches the same simple regex-style syntax. Repeatable.
- `--limit <n>`: keep only the first `n` matching results.
- `--quiet`: only print errors to stderr.
- `--log-level <error|warn|info|debug|trace>`: set stderr verbosity explicitly.
- `-v`, `-vv`, ...: increase log verbosity starting from the default `warn` level.
- `-C`, `--show-changes`: for `file-diff`, include keys that exist in both files but have different values.
- `--touch`: force writing output files even when generated bytes are identical.
- `--output-encoding <utf8-no-bom|utf8-bom|utf8>`: control output file encoding. `utf8` behaves like `utf8-no-bom`.

By default, cirup avoids rewriting output files when content has not changed.
By default, cirup writes JSONL to stdout, logs at `warn` level, and avoids rewriting output files when content has not changed.

`--summary` emits compact metadata such as counts, write intent, and whether output would be truncated. `--check` is intended for automation and returns exit code `2` when a command would produce changes.

`--key-filter` and `--value-filter` are intentionally limited to a SQL-translatable subset. Unsupported syntax such as `|`, `()`, `[]`, `{m,n}`, `+`, and lookarounds is rejected instead of being interpreted as full regex.

## Common operations

Expand All @@ -46,12 +60,24 @@ By default, cirup avoids rewriting output files when content has not changed.
cirup file-print input.resx
```

Show a human-readable table instead:

```bash
cirup --output-format table file-print input.resx
```

Write the printed content to a file:

```bash
cirup file-print input.resx output.json
```

Preview the same operation without writing the output file:

```bash
cirup --dry-run file-print input.resx output.json
```

### Convert between formats

```bash
Expand Down Expand Up @@ -81,6 +107,18 @@ Show keys present in `file1` but missing in `file2`:
cirup file-diff file1.resx file2.resx
```

Count missing keys without writing the full result set:

```bash
cirup --count-only file-diff file1.resx file2.resx
```

Ask only whether differences exist:

```bash
cirup --check file-diff file1.resx file2.resx
```

Write diff to file:

```bash
Expand Down Expand Up @@ -125,6 +163,30 @@ Show keys that are in `new`, not in `old`, and also present in `base`:
cirup diff-with-base old.resx new.resx base.resx
```

Limit stdout to a subset of keys:

```bash
cirup --key-filter ^lbl --limit 25 diff-with-base old.resx new.resx base.resx
```

Match keys containing a simple wildcard sequence:

```bash
cirup --key-filter 'User.*Name' file-print input.resx
```

Filter by translated value content:

```bash
cirup --value-filter '^Hello' file-print input.resx
```

Emit a structured summary for an in-place sort without modifying the file:

```bash
cirup --dry-run --summary file-sort strings.json
```

## Output file touch behavior

- Default: if output bytes are unchanged, cirup does **not** rewrite the file.
Expand Down
6 changes: 5 additions & 1 deletion cirup_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cirup_cli"
version = "0.5.0"
version = "0.6.0"
authors = ["Marc-André Moreau <[email protected]>"]
edition = "2024"

Expand All @@ -16,6 +16,10 @@ env_logger = "0.11"
[build-dependencies]
embed-resource = "3.0.6"

[dev-dependencies]
serde_json = "1.0"
tempfile = "3.20"

[target.'cfg(all(target_os = "windows", target_arch = "aarch64"))'.dependencies.cirup_core]
path = "../cirup_core"
default-features = false
Expand Down
Loading
Loading