-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: make it more scriptable either by limiting choice to the first or enabling exact name matching #298
Comments
Did you try to use the query syntax? From the docs: -- The query language allows the user to search for contacts where a specific term $ khard list foo But when searching for The available fields are the same as in the YAML format for contacts (an empty -- If your house isn't mentioned in the name field, something like Alternatively why don't you search for "frances" directly? Or maybe you could support the I'm thinking aloud - just ignore, if you've ruled that out already. |
The OP literally contains the exact query using the query syntax:
The way I understood it, the Friend has 'Frances' as the name and the house has 'France' as the name. So the query syntax (as-is) won't help. @gfarrell even suggested changes to the query syntax that would solve the give use case:
|
Hi @scheibler and @mschilli87 : As per my original message, @mschilli87 is correct: searching for |
@gfarrell can you provide two (reduced and anonymized) vcards so that we can reproduce that? We could start by writing a test for the problem that
|
My understanding is that the contact with the French house has the name "France" so that would a naming issue, not a bug. (It's a perfectly valid name, but I think that's caused some confusion in this thread) |
@lucc: as per my original post:
This is not a bug report, as @d7415 has pointed out. It’s also the second time this issue has been misinterpreted but I’m not sure what else I can do to make the text clearer.
As I wrote originally, I am happy to implement this improvement and have suggested how it might be done, but am simply waiting for some pointers from those more familiar with the khard code base as to what the best way in would be. |
Well I did not expect a house to have a vcard with a name on its own. Nevermind. In #189 I have proposed a I would like to find a small set of options that covers as many cases as possible in order to keep the interface "uniform". So more suggestions for good options and discussion is very welcome before we start coding. I imagine the option to be toplevel for For the actual implementation we have to look at For the command line options we have |
To really answer your question: I would be happy with PRs for a more scriptable interface. There is also a whole project about this: https://github.com/scheibler/khard/projects/1 I have not thought about how to implement it exactly so you can ask for more specific pointers if you have questions. I am also happy to help discussing the design first. |
I wrote a script for khard so I can use it easily with Rofi (mimicking the functionality I used to have in Alfred when I was on macOS). The problem with this is that sometimes there are two contacts with names which cause a collision (e.g. my house in France is called "France", and I have a friend with the last name "Frances"). This causes my script to hang as khard wants interactive input. I've tried adding the UID into the list and then just selecting that with
awk
, but only a short UID is printed, so there are still multiple results when usingkhard show "uid:XXX"
.I can think of three ways of making khard more scriptable:
name:France
can only match the full name/^France$/
;name:/^France$/
;--first
flag which just picks the closest match (khard show --first "name:France"
).In fact, to make this completely scriptable, (3) is always necessary as two records might have the same names, but it's unlikely.
I'm happy to implement this and open a PR with (a) a bit of input on the best option; (b) a pointer as to where to start in the codebase.
The text was updated successfully, but these errors were encountered: