Skip to content

Commit

Permalink
Add support for displaying file sizes in bytes with a separator
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimian committed Dec 30, 2024
1 parent 1636cab commit 24bab3c
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 11 deletions.
190 changes: 184 additions & 6 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ xdg = "2.5"
git2 = { version = "0.18", optional = true, default-features = false }

[target.'cfg(unix)'.dependencies]
num-format = { version = "0.4.4", features = ["with-system-locale"] }
users = { version = "0.11.3", package = "uzers" }
xattr = "1"

[target.'cfg(windows)'.dependencies]
num-format = "0.4.4"
windows = { version = "0.43.0", features = ["Win32_Foundation", "Win32_Security_Authorization", "Win32_Storage_FileSystem", "Win32_System_Memory"] }

[dependencies.clap]
Expand Down
2 changes: 1 addition & 1 deletion doc/lsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ lsd is a ls command with a lot of pretty colours and some other stuff to enrich
: How to display permissions [default: rwx for linux, attributes for windows] [possible values: rwx, octal, attributes, disable]

`--size <size>...`
: How to display size [default: default] [possible values: default, short, bytes]
: How to display size [default: default] [possible values: default, short, bytes, bytes-with-separator]

`--sort <WORD>...`
: Sort by WORD instead of name [possible values: size, time, version, extension, git]
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub struct Cli {
pub permission: Option<String>,

/// How to display size [default: default]
#[arg(long, value_name = "MODE", value_parser = ["default", "short", "bytes"])]
#[arg(long, value_name = "MODE", value_parser = ["default", "short", "bytes", "bytes-with-separator"])]
pub size: Option<String>,

/// Display the total size of directories
Expand Down
Loading

0 comments on commit 24bab3c

Please sign in to comment.