doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
620 stars 83 forks source link

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

Open craftyguy opened 1 month ago

craftyguy commented 1 month ago

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

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)

therealchfkch commented 2 weeks ago

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 https://github.com/doy/rbw/blob/80a5651b98c3e2d1914c7099e5c3b4ac235d3c52/src/api.rs#L369 ? Maybe we can walk it up from there to the CLI output.