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

Fix for #407: Show number of hardlinks for lsd -l #459

Merged
merged 5 commits into from
Jan 31, 2021

Conversation

TheAlakazam
Copy link
Contributor

@TheAlakazam TheAlakazam commented Dec 13, 2020

  • Added implementation for displaying number of hardlinks to a file.
  • Displays '-' in windows

TODO

  • Use cargo fmt
  • Add necessary tests
  • Add changelog entry

Copy link
Member

@meain meain left a comment

Choose a reason for hiding this comment

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

Looks good, a few minor changes.

src/app.rs Outdated Show resolved Hide resolved
src/color.rs Outdated Show resolved Hide resolved
src/flags/blocks.rs Outdated Show resolved Hide resolved
src/flags/blocks.rs Outdated Show resolved Hide resolved
@meain
Copy link
Member

meain commented Dec 23, 2020

I was thinking we could change the name to links. Single word name would be better in this case.

@meain
Copy link
Member

meain commented Jan 5, 2021

Similar to changing inode_count to links, can we also change the name INodeCount to Links.
Plus make sure you add the changelog entry.

@codecov-io
Copy link

Codecov Report

Merging #459 (fd8eeb0) into master (1396c59) will decrease coverage by 0.11%.
The diff coverage is 70.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #459      +/-   ##
==========================================
- Coverage   84.58%   84.46%   -0.12%     
==========================================
  Files          35       36       +1     
  Lines        3353     3379      +26     
==========================================
+ Hits         2836     2854      +18     
- Misses        517      525       +8     
Impacted Files Coverage Δ
src/app.rs 95.83% <ø> (ø)
src/display.rs 24.61% <0.00%> (-0.13%) ⬇️
src/meta/mod.rs 17.69% <50.00%> (+0.58%) ⬆️
src/color.rs 78.64% <66.66%> (-0.36%) ⬇️
src/meta/links.rs 68.75% <68.75%> (ø)
src/flags/blocks.rs 93.91% <100.00%> (+0.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1396c59...fd8eeb0. Read the comment docs.

Copy link
Member

@meain meain left a comment

Choose a reason for hiding this comment

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

Just a few things that you missed.

Comment on lines 126 to 127
Block::Name,
Block::Links,
Copy link
Member

Choose a reason for hiding this comment

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

No links by default

Suggested change
Block::Name,
Block::Links,
Block::Name,

src/color.rs Outdated
Comment on lines 254 to 255
m.insert(Elem::Links { valid: true }, Colour::Fixed(134));
m.insert(Elem::Links { valid: false }, Colour::Fixed(222));
Copy link
Member

Choose a reason for hiding this comment

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

We could reuse the Inode colors

Suggested change
m.insert(Elem::Links { valid: true }, Colour::Fixed(134));
m.insert(Elem::Links { valid: false }, Colour::Fixed(222));
m.insert(Elem::Links { valid: true }, Colour::Fixed(13));
m.insert(Elem::Links { valid: false }, Colour::Fixed(245));

@meain
Copy link
Member

meain commented Jan 31, 2021

Awesome, thanks a lot!

@meain meain merged commit 3c342f6 into lsd-rs:master Jan 31, 2021
@FischLu
Copy link

FischLu commented Jan 22, 2023

please add links option in the config.yaml example in the README.md file, today I tired to config my lsd with this function, but didn't see it anywhere till I see this pr

@meain
Copy link
Member

meain commented Jan 22, 2023

Added in #808

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.

4 participants