Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Show size in byte #1261

Merged
merged 3 commits into from
Mar 6, 2025
Merged

Conversation

Lzzzzzt
Copy link
Contributor

@Lzzzzzt Lzzzzzt commented Oct 28, 2023

Add a cli option that show file size in bytes rather than KB or MB, etc.
solve the #1236.

@svenstaro
Copy link
Owner

Sorry for ignoring this for so long! Would you perhaps like to rebase this? I promise I'll review it quickly. :)

@Lzzzzzt
Copy link
Contributor Author

Lzzzzzt commented Sep 22, 2024

Sorry for ignoring this for so long! Would you perhaps like to rebase this? I promise I'll review it quickly. :)

OK

@Lzzzzzt
Copy link
Contributor Author

Lzzzzzt commented Sep 22, 2024

Sorry for ignoring this for so long! Would you perhaps like to rebase this? I promise I'll review it quickly. :)

I'm done

@svenstaro
Copy link
Owner

Ok, so I'm thinking: Perhaps this should be a frontend option like the sorting method and sorting order? It would be consistent since it's a display thing like those other options. There could be a button in the "Size" row that would allow you to toggle this (and it'd change the query parameter).

We can still have something like --default-size-display which is either human or exact. What do you think about that?

@Lzzzzzt
Copy link
Contributor Author

Lzzzzzt commented Oct 12, 2024

Ok, so I'm thinking: Perhaps this should be a frontend option like the sorting method and sorting order? It would be consistent since it's a display thing like those other options. There could be a button in the "Size" row that would allow you to toggle this (and it'd change the query parameter).

We can still have something like --default-size-display which is either human or exact. What do you think about that?

Agreed! Keeping it consistent with sorting options and adding a toggle in the “Size” row makes sense. I’m good with the --default-size-display flag too.

@Lzzzzzt
Copy link
Contributor Author

Lzzzzzt commented Oct 13, 2024

There could be a button in the "Size" row that would allow you to toggle this (and it'd change the query parameter).

It seems there is no suitable place for the button in the table header, I think the Size string in the entry could be a button to change the display behavior. And this will change other entries' display behavior, not only the clicked one.

@svenstaro
Copy link
Owner

Do you want to rebase this and for the time being just exchange --show_size_in_byte for --size-display with an enum that is either human or exact? I'd like to get this into the next release if possible. Let's ignore the frontend stuff for the time being.

Lzzzzzt added 2 commits March 3, 2025 17:49
Add a cli option that show file size in bytes rather than KB or MB, etc.
@Lzzzzzt
Copy link
Contributor Author

Lzzzzzt commented Mar 5, 2025

Do you want to rebase this and for the time being just exchange --show_size_in_byte for --size-display with an enum that is either human or exact? I'd like to get this into the next release if possible. Let's ignore the frontend stuff for the time being.

Ok

Signed-off-by: Lzzzt <[email protected]>
@Lzzzzzt Lzzzzzt force-pushed the show-size-in-byte branch from a5c32b5 to d2e6c0d Compare March 6, 2025 05:31
@Lzzzzzt
Copy link
Contributor Author

Lzzzzzt commented Mar 6, 2025

Do you want to rebase this and for the time being just exchange --show_size_in_byte for --size-display with an enum that is either human or exact? I'd like to get this into the next release if possible. Let's ignore the frontend stuff for the time being.

I've rebased and changed cli args, could you review the code?

(build_link("size", &format!("{}", size), sort_method, sort_order))
@if show_exact_bytes {
span.mobile-info.size {
(maud::display(format!("{}B", size.as_u64())))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we display it the same as the human format with {} B instead of {}B?

@svenstaro svenstaro merged commit 1472a05 into svenstaro:master Mar 6, 2025
17 checks passed
svenstaro added a commit that referenced this pull request Mar 6, 2025
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.

2 participants