haampie / libtree

ldd as a tree
MIT License
2.63k stars 60 forks source link

Add a --max-depth flag #71

Closed haampie closed 2 years ago

haampie commented 2 years ago

Closes #70.

With --max-depth 1 you get direct deps only, no need to do shell magic with ldd | grep $(readelf -d <file> | grep NEEDED | ??):

$ ./libtree --max-depth 1 /usr/bin/vim
/usr/bin/vim
├── libpthread.so.0 [ld.so.conf]
├── libpython3.8.so.1.0 [ld.so.conf]
├── libgpm.so.2 [ld.so.conf]
├── libacl.so.1 [ld.so.conf]
├── libcanberra.so.0 [ld.so.conf]
├── libselinux.so.1 [ld.so.conf]
└── libtinfo.so.6 [ld.so.conf]