Evidlo / passhole

A secure hole for your passwords (KeePass CLI)
GNU General Public License v3.0
199 stars 19 forks source link

add argument --group to the ph list command #14

Closed ljurk closed 5 years ago

ljurk commented 5 years ago

Hey Evan, thanks for your great work here. I did a slight change on the code, that is in my opinion pretty usefull if you have many groups and entries in your database: I added a --group argument to ph list, so that i can only see the entries of the given group. What do you think? Do you have any suggestions how I could make it better?

Greetings Lukn

Evidlo commented 5 years ago

Hi, thanks for the contribution.

I think a more natural syntax for what you propose would be something like this:

>>> ph ls example_group/
example1
example2
subgroup
├── example3
└── example4
>>> ph ls example_group/example1
example1

And for consistency with the other commands, let's require paths to groups to end with '/'.

ljurk commented 5 years ago

Hi, alright, the code works now as you suggested. First I had Problems with the default for this argument, I want that "ph list" works too without args. "nargs" solved this for me, "ph list" is now the same as "ph list /"

In my opinion "ph ls example_group/example1", isn't that useful. For that purpose is ph show I think. I didn't touched list_entries to much, i think for listing one single entry i have to do a little bit more. Or do you have a simple idea how i could achieve this?

ljurk commented 5 years ago

Ok, it wasn't that hard. Now you can also type

>>> ph ls example_group/example1
example1

I hope you like it:) Greetings Lukn

Evidlo commented 5 years ago

Looks good, thanks!