Closed elumbella closed 4 years ago
I added 970af75 but can not reproduce your problem. Can you please explain what I need to do to see the bug. If possible you should give a minimal example including vcards, config and commands you use.
Alright, I tested again. It seems, khard has an issue with the term CAT
as I get very weird results when using this specific word. Possibly it is giving me all contacts that have some category. I tried reproducing with another string and this reproduces.
8y7rgopzm4rkvdns221iqmqzhjimuzib57jn.vcf, an example contact
BEGIN:VCARD VERSION:3.0 UID:8y7rgopzm4rkvdns221iqmqzhjimuzib57jn CATEGORIES:FBY FN:test person N:person;test;;; REV:202001dT152538Z END:VCARD
khard.conf
[addressbooks] [[nextcloud]] path = ~/.contacts/nextcloud/contacts
[general] editor = nvim merge_editor = vimdiff default_action = list show_nicknames = no
[vcard] search_in_source_files = yes
khard FBY
outputs the test person, whereas khard email FBY
says Found no email addresses
edit: haven't tried that with your commit yet
khard FBY
outputs the test person, whereaskhard email FBY
saysFound no email addresses
But that contact doesn't have an email address, so that would be expected.
If the contact does not have an email address it is not listed when using khard email
. That is expected. What is an email program going to do with a contact that does not have an email address?
Why "CAT" is special:
khard show ...
). If the vcard has a category that is titled by the text "Categories" which obviously matches "CAT".I added an email address to the test contact and it now seems to work. The weird thing is, it doesn't work with my own contacts. I'm using the category FBX
. FBY
somehow works fine but FBX
doesn't.
so what exactly should happen with the fbx category and what is happening instead? The more specific the better ...
Just as mentioned before. Contacts with the category fbx show up with khard fbx
but don't with khard email fbx
Alright, I think I have it narrowed down:
khard <term>
shows all contacts which contain <term>
somewhere.
khard email <term>
only shows contacts, where <term>
is somewhere in the name or the email address. It is thus impossible to search for categories (or, for that matter, anything else besides name and email address) when using the email
argument
@elumbella I tried to update the tests according to your last comment. See the commit f366f4. I am doing this:
khard ls bar
returns that contactkhard email bar
also returns that contactEither I am missunderstanding you your description or I don't know what. Can you please write a complete test case that I can execute on travis? The mentioned commit still passes.
I am very confused... You are right, your tests pass on my system as well. It seems to fail only with the literal category "fby". Can you try that string as a category? If it this specific string that isn't working, then I have absolutely no clue what could be wrong. As mentioned before, the string "fby" somehow works...
I don't know what else to provide. I have provided everything that should be necessary. I don't know what more you want...
And by that I mean, as a commit so that I do not have to code anything.
How should I provide you with the scenario?
I don't know what else to provide. I have provided everything that should be necessary. I don't know what more you want...
I want something that actually fails when I try/execute it. So far you have given me many descriptions of what I as a human have to do. But every time I tried it I did not see anything failing.
So in order to prevent any misscommunication I want code that fails. Not instructions for a human but instructions for a computer. And in order to not get mixed up in differences between our private computers I want the code to fail on travis.
How should I provide you with the scenario?
As a test case in the test suite of khard.
By "test case" I mean a function like this: https://github.com/scheibler/khard/blob/970af752041daf779e6e2fe278b2b691458baec3/test/test_command_line_interface.py#L157-L167
So you open that file write some new function in there that tests your problem. Then you open a pull request for that change and we will see if the tests on travis fail.
Hrm. I'm not a programmer, so that will be quite the challenge. I will see what I can do and report back once I have something (hopefully) appropriate to your specifications.
I'm trying to get full search results for usage with mutt. In my case, I want to find all contacts belonging to a certain category CAT. All of them have
Category: CAT
in their respective vCard files.
khard CAT
yields the desired results, whereas
khard email CAT
doesn't. It seems as if only the visible fields are searched (i.e. Name, Type and E-Mail)l. This is still the case with
search_in_source_files = yes
in khard.conf as well as adding the flag--search-in-source-files
.