feat: enhance --mounts: display mount root path#1463
Conversation
2ade1e8 to
2702e78
Compare
There was a problem hiding this comment.
Thanks, this is pretty cool. One thing I do think would be nice before merge is if the mounts would be aligned on the grid (and respect the --header flag as well). Currently, the mounts are unaligned.
E.g. see:
$ eza -l / --mounts --header --no-permissions --no-user --no-filesize --no-time
Name
bin
boot [/dev/nvme0n1p1 (vfat)]
dev [devtmpfs (devtmpfs)]
etc
home [zpool/home (zfs)]
lib
lib64
mnt
nix [zpool/nix (zfs)]
opt
proc [proc (proc)]
root
run [tmpfs (tmpfs)]
rustup
srv
sys [sysfs (sysfs)]
tmp [tmpfs (tmpfs)]
usr
var [zpool/var (zfs)]
The path of root is printed in square brackets next to a mount source, similar to `findmnt` command output. The root is not displayed if it equals to `/`. Example: ``` mkdir /foo && mkdir /bar; mount --bind /bar /foo eza -l --mounts / # /bar # /foo [/dev/sda1[/bar] (ext4)] # ... findmnt /foo # /foo /dev/sda1[/bar] ext4 rw,relatime,errors=remount-ro ``` This is useful for `mount --bind` as well as for mounts of non-default btrfs subvolumes.
|
@cafkafk Oh wait, after some thought, it began to seem to me that mount are rather similar to symlik destinations. And symlinks destinations seems not aligned in both So, do you really think mounts should be aligned regardless? |
gierens
left a comment
There was a problem hiding this comment.
@vlad20012 Code and functionality looks fine to me! Thanks! ... @cafkafk regarding the alignment, I think this would unnecessarily complicate this PR ... I'd rather see this in a separate PR that then might also tackle the missing alignment of symlink targets.
|
@cafkafk, |

The path of mount root is now printed in square brackets next to a mount source, similar
to
findmntcommand output. The root is not displayed if it equals to/.Example:
This is useful for
mount --bindas well as for mounts of non-default btrfs subvolumes.Linux only.