Skip to content

Commit 481844b

Browse files
committed
Add support for displaying file sizes in bytes with a separator
1 parent 1636cab commit 481844b

File tree

8 files changed

+296
-13
lines changed

8 files changed

+296
-13
lines changed

Cargo.lock

+184-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ xdg = "2.5"
5252
git2 = { version = "0.18", optional = true, default-features = false }
5353

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

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

6163
[dependencies.clap]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ recursion:
223223

224224
# == Size ==
225225
# Specifies the format of the size column.
226-
# Possible values: default, short, bytes
226+
# Possible values: default, short, bytes, bytes-with-separator
227227
size: default
228228

229229
# == Permission ==

doc/lsd.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ lsd is a ls command with a lot of pretty colours and some other stuff to enrich
126126
: How to display permissions [default: rwx for linux, attributes for windows] [possible values: rwx, octal, attributes, disable]
127127

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

131131
`--sort <WORD>...`
132132
: Sort by WORD instead of name [possible values: size, time, version, extension, git]

src/app.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub struct Cli {
7373
pub permission: Option<String>,
7474

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

7979
/// Display the total size of directories

src/config_file.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ recursion:
305305
306306
# == Size ==
307307
# Specifies the format of the size column.
308-
# Possible values: default, short, bytes
308+
# Possible values: default, short, bytes, bytes-with-separator
309309
size: default
310310
311311
# == Permission ==

0 commit comments

Comments
 (0)