Skip to content

Conversation

@danglingptr0x0
Copy link

hey!

I work a lot with hex and couldn't find any directory lister that supported it, but while looking, I found eza and decided to add this. --hex shows sizes in 0x-prefixed hex

..[$] <( (git)-[main]-)> ./target/release/eza -TxlF --hex
drwxr-xr-x        - dangling 11 Oct 17:36 ./
drwxr-xr-x        - dangling 11 Oct 17:28 ├── benches/
.rw-r--r--    0x268 dangling 11 Oct 17:28 │   └── my_benchmark.rs
.rw-r--r--   0x101a dangling 11 Oct 17:28 ├── build.rs
.rw-r--r--   0xd366 dangling 11 Oct 17:28 ├── Cargo.lock
.rw-r--r--    0xe12 dangling 11 Oct 17:28 ├── Cargo.toml
.rw-r--r--   0xdbf2 dangling 11 Oct 17:28 ├── CHANGELOG.md
.rw-r--r--   0x15d3 dangling 11 Oct 17:28 ├── CODE_OF_CONDUCT.md

Copilot summary:

This pull request adds support for displaying file sizes in hexadecimal format using a new --hex flag. The change is implemented across the codebase, including the core logic, help documentation, man page, and shell completions for various shells. The new option is mutually exclusive with existing size display options and is fully integrated into the argument parsing and rendering logic.

New feature: Hexadecimal file size display

Added a --hex flag that allows users to display file sizes in hexadecimal format (e.g., 0x1a3f). This is implemented in the argument parsing (flags.rs), the size formatting logic (view.rs, table.rs), and the output rendering for both block size and file size columns (blocks.rs, size.rs).

Documentation updates

Updated the README.md, help output, and man page to document the new --hex option and its behavior.

Shell completions

Added the --hex flag to shell completions for Fish, Nushell, PowerShell, and Zsh to ensure discoverability and ease of use for users of those shells.

These changes collectively introduce a new way to view file sizes and ensure that the feature is well-documented and accessible through all user interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant