doy/rbw

request: add --sort-by option to "list" command

craftyguy opened this issue · 1 comments

This is a request to add support for sorting the output from rbw list, based on some things like:

  • popularity / usage count
  • the date added/modified

The option could be used like: rbw list --sort-by=usage and rbw list -s date. I don't think there needs to be an additional option/flag to set the sort direction (asc vs desc), it's easy to reverse the output from rbw using some other cli tool.

For some context on why I think sorting by usage count is useful: I use rbw with fzf, and it would be great to have the most common/used entries at the top so I can save keystrokes (I use rbw like this dozens of times per day :D)

I would be glad to use this feature aswell, but from a different angle: I need the data, since i include rbw as a library for my GUI project.
If i recall correctly, if i wanted to start a PR, i would extend the SyncRes for each respective element here

rbw/src/api.rs

Line 369 in 80a5651

struct SyncRes {
?
Maybe we can walk it up from there to the CLI output.