Add support for displaying file sizes in bytes with a separator#1112
Add support for displaying file sizes in bytes with a separator#1112fgimian wants to merge 1 commit intolsd-rs:masterfrom fgimian:support-bytes-with-separator
Conversation
|
Investigating why the unit test is failing on Unix (I'm on Windows but will setup WSL or a VM to test and see what's going on). Edit: I have to admit, I have no idea why this is failing for specific Linux configurations. Any ideas would be more than welcome! 😄 Another Edit: I can see this is failing via cross-compilation which is something I can reproduce so I'll check this out further tomorrow. I'll switch this to draft until everything is resolved, so sorry. |
|
OK, the problem is simply that the failing environments don't have the required locales pre-installed. As an example, the cross image used ( root@cd931a9b586d:/# locale -a
C
C.UTF-8
POSIX
root@db27beebc168:/# export LC_ALL=en_US.UTF-8
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directoryThis can be rectified within the image, but this may be quite tedious to do via CI. e.g. # Install the locales package.
apt install locales
# Generate the required locale for testing.
locale-gen en_US.UTF-8
# Observe the locale is now available.
locale -aExporting the locale now works: root@cd931a9b586d:/# export LC_ALL=en_US.UTF-8
root@cd931a9b586d:/#Sadly all the provided locales define an empty string as a separator which makes it a bit more challenging to set. However, what I may be able to do is detect whether the locale is available and taylor the test accordingly. |
|
I think this is now ready for review 😊 |
|
Just a little FYI that I've been using this for the last day and it works really well. 😄 |
|
Friendly ping on this PR :) Would love this feature personally. |
|
@zwpaper Kindly let me know if you are interested in this PR. I personally no longer use lsd and would like to delete my fork to clean up my repos. |
|
Hi @fgimian, apologies for the off; I was concentrated on a new project for a while, I now have some time to look into LSD at some time. I have checked the PR, mostly LGTM, but I believe that it would be good to use a new flag for the separator, let me update it and get this merged. |
This is a redo of the excellent work by @areq212 on PR #569 for supporting thousand separators when displaying bytes.
TODO
cargo fmt