Skip to content

Commit dec5e81

Browse files
authored
Merge pull request #120 from chaqchase/feat/upgrades
Upgrades and life improvement updates
2 parents 6811761 + 97d5c4d commit dec5e81

File tree

19 files changed

+1561
-46
lines changed

19 files changed

+1561
-46
lines changed

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,47 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.0] - 2025-01-10
9+
10+
### Added
11+
12+
- Stable machine-readable outputs with streaming:
13+
- `--json`: Outputs a single JSON array (streamed). Supports `--pretty` for human-friendly indentation.
14+
- `--ndjson`: Newline-delimited JSON, one object per line.
15+
- `--csv`: CSV with a header row. Proper escaping and UTF-8 handling via the `csv` crate.
16+
- Flags are mutually exclusive; `--pretty` only affects `--json`.
17+
- Stable schema across machine modes with these fields (always present; nulls where appropriate):
18+
- `path`, `name`, `extension`, `file_type`, `size_bytes`, `modified`, `created`, `accessed`, `mode_octal`, `owner_user`, `owner_group`, `inode`, `hard_links`, `symlink_target`, `is_hidden`, `git_status`, and `plugin` container for plugin enrichments.
19+
- Streaming output writers to avoid unbounded memory growth on large listings.
20+
- Optional Git status integration into machine outputs when `-G` is used (no extra git work otherwise).
21+
- Archive introspection (no extraction to disk):
22+
- Automatic detection for `.zip`, `.tar`, `.tar.gz`, `.tgz` when a single archive file is passed as the path
23+
- Lists archive contents as a virtual directory and integrates with existing views: default, long, table, grid, tree, recursive
24+
- Works with filters, sorting, depth control, and machine outputs (`--json`, `--ndjson`, `--csv`)
25+
- Symlink targets in tar archives are exposed as `custom_fields["symlink_target"]`
26+
- Single-file listing:
27+
- Passing a regular file path now lists that single file (instead of erroring with Not a directory)
28+
- All formatters and machine outputs apply normally
29+
- Long format quality-of-life flags:
30+
- `--hide-group`: Hide the group column (great for single-user systems). Also configurable via `formatters.long.hide_group` in the config file.
31+
- `--relative-dates`: Show relative modified times (e.g., "2h ago"). Also configurable via `formatters.long.relative_dates`.
32+
- Relative dates are powered by `chrono-humanize` for accurate human-friendly phrasing.
33+
34+
### Changed
35+
36+
- CLI: Added mutually exclusive flags group for machine output (`--json`, `--ndjson`, `--csv`) and `--pretty`.
37+
- Internal: Introduced `OutputMode` in CLI args to route to human vs machine formatters.
38+
- Internal: Added a serializable adapter to normalize timestamps to ISO-8601 UTC and permissions to octal.
39+
- Docs: Updated README with a new "Machine Output" section including schema and examples.
40+
- Long format date column alignment is now consistent even when using relative dates.
41+
- Grid formatter no longer appends an extra trailing blank newline; output ends without an extra empty line.
42+
43+
### Fixed
44+
45+
- Non-fatal metadata read failures are handled gracefully during machine output; entries still emit with nulls where needed and a warning on stderr, without corrupting stdout.
46+
- Graceful handling when the provided path is a single file or an archive: no erroneous directory reads
47+
- Relative date phrasing now correctly uses "X ago" for past times and "in X" for future times.
48+
849
## [0.3.11] - 2025-01-09
950

1051
### Added

Cargo.lock

Lines changed: 169 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)