Canop / broot

A new way to see and navigate directory trees : https://dystroy.org/broot
MIT License
10.64k stars 234 forks source link

Add `toggle_tree` flag to show only items in the current dir #800

Closed eldad closed 10 months ago

eldad commented 10 months ago

This PR aims to address issue https://github.com/Canop/broot/issues/670

Thanks for creating and maintaining this tool!

eldad commented 10 months ago

This commit unintentionally changed the default behavior to not display the tree, I am pushing a commit to change the default behavior back to what it is currently.

eldad commented 10 months ago

The last commit is now the desired behavior, default to show the tree.

Canop commented 10 months ago

Having "toggle" in a launch argument isn't semantically right: most other arguments are toggles anyway. It also doesn't say whether it toggles towards enabling a tree view or disabling it.

IMO the right semantic is what we have for other toggles: a couple of launch arguments --tree and --no-tree. This would also make it possible to have --no-tree in default_flags in the config and to override it with --tree at launch.

(another option would be to just don't have a launch parameter as we can do --cmd :toggle_tree)

If you prefer, I can do the change myself starting from your last commit.

eldad commented 10 months ago

Having "toggle" in a launch argument isn't semantically right: most other arguments are toggles anyway. It also doesn't say whether it toggles towards enabling a tree view or disabling it.

Yes, I agree. That is not intuitive.

If you prefer, I can do the change myself starting from your last commit.

I added now the change as you suggested - please feel free to edit it further as you see fit.