zevv / duc

Dude, where are my bytes: Duc, a library and suite of tools for inspecting disk usage
GNU Lesser General Public License v3.0
598 stars 79 forks source link

If DB contains only one path, default to that path if one is not specified when using ls, ui, or the like #316

Open felder opened 1 year ago

felder commented 1 year ago

While not super essential, a nice feature would be for duc to assume a default for the path if the db only contains a single top level path and no path was specified.

This prevents having to separately query the database to find a path to specify.

For example:

# duc info -d filestore.db
Date       Time       Files    Dirs    Size Path
2023-08-18 21:04:14       0      13   52.0K /export/filestore
# duc ls -d filestore.db
Path /export/reports not found in database
Requested path not found
Segmentation fault (core dumped)
# duc ls -d filestore.db /export/filestore
 48.0K filestore

It just seems less useful for it to assume the cwd is the path when that is not in the index.

Also I assume the segfault is a result of #236

felder commented 1 year ago

I just upgraded to duc 1.4.5 and I can happily report the segfault is gone.