Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ffec773
feat(output): add yaml output
Dustin-Jiang Sep 30, 2025
97d6bfb
docs: update CHANGELOG
Dustin-Jiang Sep 30, 2025
cdb7bc0
fix: escape path, and disable permission display on Windows
Dustin-Jiang Sep 30, 2025
c9cbb25
fix(ci): fix warnings in cargo clippy
Dustin-Jiang Sep 30, 2025
192ca92
refactor: make output stateful
Dustin-Jiang Sep 30, 2025
602b389
feat(output): add json output
Dustin-Jiang Sep 30, 2025
eb2f10d
fix(ci): fix warnings in cargo clippy
Dustin-Jiang Sep 30, 2025
4ea0ed3
fix: fix function calling in Windows
Dustin-Jiang Sep 30, 2025
e225946
fix: fix reference mutable type annotation in Windows
Dustin-Jiang Sep 30, 2025
977ee0e
fix: resolve suggested changes
Dustin-Jiang Oct 10, 2025
6434ee5
fix: move JSON array printing to Printer
Dustin-Jiang Oct 10, 2025
b2d385f
feat: implement NDJSON output
Dustin-Jiang Oct 11, 2025
703b32f
fix(ci): fix warnings in cargo clippy
Dustin-Jiang Oct 11, 2025
650e86c
tests: add tests for `--output` flags
Dustin-Jiang Oct 12, 2025
2e463c7
docs: update manpage for `--output` flags
Dustin-Jiang Oct 12, 2025
e46cce0
Merge branch 'master' into feature-yaml
Dustin-Jiang Oct 13, 2025
10570e9
tests: fix invalid utf8 base64 test
Dustin-Jiang Oct 15, 2025
949a5aa
docs: update manpage to change "ndjson" to "jsonl"
Dustin-Jiang Oct 15, 2025
cb3ef97
fix: change FileDetail creating logic and base64 import
Dustin-Jiang Oct 15, 2025
60ecc09
fix: change ndjson flag to commonly used jsonl
Dustin-Jiang Oct 16, 2025
7c9f1d8
fix: replace String to &str with lifetime, adopt as_encoded_bytes
Dustin-Jiang Oct 29, 2025
2c1bdb5
feat: add --json flag for JSONL output
Dustin-Jiang Oct 29, 2025
e831976
docs: add --json flag to manpage
Dustin-Jiang Oct 29, 2025
30c9e86
Merge branch 'master' into feature-yaml
Dustin-Jiang Oct 29, 2025
49654f4
fix(clippy): collapse if blocks
Dustin-Jiang Nov 2, 2025
e4741c0
Merge remote-tracking branch 'origin/master' into feature-yaml
Dustin-Jiang Nov 2, 2025
4a0ecc5
Merge remote-tracking branch 'origin/master' into feature-yaml
Dustin-Jiang Nov 8, 2025
56d347e
fix: remove the `--output` flag
Dustin-Jiang Nov 8, 2025
6db4409
tests: fix `--output` tests to `--json`
Dustin-Jiang Nov 9, 2025
c2c8497
docs: add fields explaination in manual
Dustin-Jiang Nov 13, 2025
13d0868
docs: change the flag to `--json` in CHANGELOG.md
Dustin-Jiang Nov 13, 2025
47ee6ce
fix(printer): make `Priner.stdout` private
Dustin-Jiang Nov 13, 2025
58b90f7
Merge remote-tracking branch 'origin/master' into feature-yaml
Dustin-Jiang Nov 13, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Features

- Add `--yaml` flag for YAML format output.

## Bugfixes

Expand Down
21 changes: 21 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,27 @@ pub struct Opts {
)]
search_path: Vec<PathBuf>,

/// Print results as YAML objects so you can use it with tools like yq and nushell.
#[arg(
long,
value_name = "yaml",
conflicts_with("format"),
conflicts_with("list_details"),
help = "Print results as YAML objects so you can use it with tools like yq and nushell."
)]
pub yaml: bool,

/// Print results as a JSON array so you can use it with tools like jq and nushell.
#[arg(
long,
value_name = "json",
conflicts_with("format"),
conflicts_with("list_details"),
conflicts_with("yaml"),
help = "Print results as a JSON array so you can use it with tools like jq and nushell."
)]
pub json: bool,

/// By default, relative paths are prefixed with './' when -x/--exec,
/// -X/--exec-batch, or -0/--print0 are given, to reduce the risk of a
/// path starting with '-' being treated as a command line option. Use
Expand Down
6 changes: 6 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ pub struct Config {

/// Whether or not to use hyperlinks on paths
pub hyperlink: bool,

/// Whether or not to print the result as a JSON array
pub json: bool,

/// Whether or not to print the result as YAML objects
pub yaml: bool,
}

impl Config {
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config
actual_path_separator,
max_results: opts.max_results(),
strip_cwd_prefix: opts.strip_cwd_prefix(|| !(opts.null_separator || has_command)),
json: opts.json,
yaml: opts.yaml,
})
}

Expand Down
Loading