lucc / khard

Console vcard client
https://khard.readthedocs.io/en/latest/
GNU General Public License v3.0
595 stars 66 forks source link

Single .vcf file #319

Open avidseeker opened 1 year ago

avidseeker commented 1 year ago

Whenever a new contact is added, khard creates a whole new .vcf file just for that contact.

Typical contact services combine all contacts into one .vcf file. E.g: friends.vcf, work.vcf, academic.vcf, and so on...

It would be more cleaner if khard can combine events into a single vcf file and keeps it updated.

lucc commented 1 year ago

This is a design decision of khard, see the docs. If you really think khard needs to do it this way you will have to present a more thorough argument. E.g: I do not know which "typical" other services you are talking about. Please also clarify what you mean by "cleaner", I personally consider it cleaner if each contact is in one file. One address book is represented by one folder of .vcf files.

If you just need a bunch of contacts in one file for some other use case outside of khard you can combine them easily:

khard file | xargs -d '\n' cat
# or 
khard file some search terms | xargs -d '\n' cat
lucc commented 1 year ago

Or are you maybe looking for the possibility to manage separated address books? Then look for the [addressbooks] section in the config file and the --addressbook command line option.

avidseeker commented 1 year ago

which "typical" other services

Google, Protonmail, and all the rest of contact apps expect to import and export one .vcf file (unless the intention is to send one contact card).

what you mean by "cleaner"

By cleaner I mean that I can easily know where a contact is saved just by looking at the filenames, and that I don't need extra work for that contact to be imported/exported with its group.

lucc commented 1 year ago

To be honest I am not sold. This sounds like very explicit use case which might also be handled by a custom shell script instead of rewriting the internals of khard.

That being said if you want to work on this here is what you might try (unless you come up with a better idea):

That would be the rough plan, I probably missed many details but they will inevitably come up once you start coding.