Skip to content
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

Support storing more than one postal address per contact #31

Closed
henrycatalinismith opened this issue Apr 19, 2013 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@henrycatalinismith
Copy link
Owner

The lack of this functionality is occasionally annoying. ppl post ought to work like email and phone somehow, so that contacts can have more than one postal address each.

The only thing standing in the way of this right now is my uncertainty regarding unique identifiers for postal addresses. In order to store multiple addresses, there needs to be a way to identify each address uniquely like so:

$ ppl post bob <unique-identifier> --country Afghanistan

For phone numbers and email addresses, the data is its own unique identifier, and that seems to work just fine. Postal addresses are composed of several pieces of data, so that approach doesn't work for them.

The vCard format's ADR property does support a TYPE parameter, but I'm wary of misappropriating it as a unique identifier. In RFC2426, the example usage of TYPE suggests more of a "list of tags" usage than anything else:

ADR;TYPE=dom,home,postal,parcel:;;123 Main Street;Any Town;CA;91921-1234

Another option would be ordering the addresses lexicographically and giving each one a number based on its position in that list.

$ ppl post bob
1. 3701 Southwest 12th Street, Topeka, Kansas, USA
2. 350 5th Avenue, New York City, New York, USA, 10118
$ ppl post bob --delete 2
$ ppl post bob
1. 3701 Southwest 12th Street, Topeka, Kansas, USA

But this has the potential to create quite a confusing user experience. For example, consider what would have happened in the above example if the user instead ran ppl post bob --delete 1. The address that used to be 2 would now be 1, and unless they re-ran the ppl post bob command this would not be clear. The confusion would increase exponentially the more postal addresses the contact had.

Despite the above concerns, that number-based unique identifier is the best I've been able to come up with so far.

@pigmonkey
Copy link
Contributor

I'm liking the idea of having numeric identifiers for more than just addresses. I've gone through and updated my contacts' phone numbers a couple times recently. First to set a type, then to specify preferred numbers. Typing out the phone number whenever I want to do anything to it gets old, and I already need to do a ppl phone johnd first so that I can get the phone number.

To set a preferred phone number, right now I need to do this:

$ ppl phone johnd
    123-555-1234 (cell)
    123-555-5678 (work)
$ ppl phone johnd 123-555-1234 -p

It would save keystrokes if I could also do something like this:

$ ppl phone johnd
1.    123-555-1234 (cell)
2.    123-555-5678 (work)
$ ppl phone johnd 1 -p

@henrycatalinismith
Copy link
Owner Author

I know what you mean, that can be a bit of a pain. Incidentally, I recently spent some time expanding on the bash completion code you contributed, so that it can autocomplete things like this.

$ ppl phone james<tab>        # pressing tab shows suggested matches
james.jones@work.com     jamie@home.com
$ ppl phone james jamie<tab>  # pressing tab autocompletes the remaining address
$ ppl phone james jamie@home.com

Since doing that, it's been much less frustrating. I'm not sure how this whole thing will turn out just yet, though. On the one hand., I'm extremely dubious of numerical identifiers. In the past I've used CLI todo list software that relied on them, and it was a never-ending usability nightmare remembering all these arbitrary numbers that constantly shifted around when things were created and deleted. I found myself having to re-output the list every other command.

But on the other hand, I plan to build them into ppl post anyway, and I'll try to keep my mind open when I do. Once they're built into that command, I am intrigued to see how I feel about numerical identifiers. If nothing else it'll be an interesting challenge trying to make them work better than my previous experiences with them, and if it works out well enough, who knows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants