-
-
Notifications
You must be signed in to change notification settings - Fork 104
feat: Add import-vcard and make-vcard commands to repl #7048
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,18 +80,26 @@ Connect to your mail server (if already configured): | |
> connect | ||
``` | ||
|
||
Create a contact: | ||
Export your public key to a vCard file: | ||
|
||
``` | ||
> make-vcard my.vcard 1 | ||
``` | ||
|
||
Create contacts by address or vCard file: | ||
|
||
``` | ||
> addcontact [email protected] | ||
> import-vcard key-contact.vcard | ||
``` | ||
|
||
List contacts: | ||
|
||
``` | ||
> listcontacts | ||
Contact#Contact#11: [email protected] <[email protected]> | ||
Contact#Contact#Self: Me √ <[email protected]> | ||
1 key contacts. | ||
2 key contacts. | ||
Contact#Contact#10: [email protected] <[email protected]> | ||
1 address contacts. | ||
``` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if we support whitespaces in arguments (but only if we want the repl tool to be really useful, not just for testing), AFAIU currently you can't import a vcard from, say, "Bob Smith.vcf". Maybe backslash escaping is enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, the classic filenames-with-spaces problem. This code is downstream from the logic that parses
arg1
andarg2
, so it would be messy to fix this without changing the whole parser strategy. (I suppose we could re-parse all ofline
inside theimport-vcard
handler, but that doesn't seem like a good path to start going down.) For the export (make-vcard
), I had originally implemented this with the file as the second argument, which probably would support spaces, because of howarg2
is created, but I moved the filename to the first argument because I wanted to take advantage of the multiple contact support ofmake_vcard()
instead of artificially limiting it to one, thus not fully exposing the interface of the underlying function. But we still would have the problem onimport-vcard
unless we added some other placeholder argument that forces the filename toarg2
.Other commands in the repl have the same limitation, like
sendhtml
, so without major changes, we probably just have to live with only handling "nice" filenames. (And if it ever is revised, then we hope nobody complains that we broke the syntax for sending a file whose name is a single backslash, the "xkcd 1172" effect.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, of course supporting spaces in filenames should be implemented for all commands then, so better not in this PR. Breaking support for "\" as a filename is fine, in favor of "\\". For now let's wait a bit for other reviewers, if any, and merge this.