-
Notifications
You must be signed in to change notification settings - Fork 200
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
WIP: Use parsedatetime for khal list
#491
Conversation
Example usage:
|
Some first ideas, opinions, reservations:
The biggest plus for parsedatetime is, that it probably has fewer bugs than our own implemenation(s). |
I believe that at, new, and list all use the same function to parse dates and more (at least I think I wrote it that way) if true then this is where the parse date time should go Just for some background, gcalcli allows optional parse datetime, if it is installed it will use it, otherwise it uses its own stricter parser (like ours) I say we try something like that, maybe even only use parse datetime if our parser fails and it is installed Anyway just my opinion
|
I'd rather remove at in favor of this command (entering just the start date gets you the same behavior).
In todoman we fall back to the configured dateformat, also an option here.
Strong disagree, makes the whole thing much more complex. Arguments are not optional. Options are optional.
I didn't observe that behavior at all. If I set |
2e313a3
to
2e2b6b1
Compare
re locale: you are right, setting a environment variable works fine, I followed the example in the documentation and than it doesn't. |
I won't merge anything that removes the argument parsing, I'm not against having options as an alternative. |
I don't understand why you insist on having your own argument parsing instead of using normal options. This makes the entire CLI harder to understand since it's a non-standard thing. |
Quoting Markus Unterwaditzer (2016-09-06 22:31:48)
I do not insist on having my own argument parsing, I'll happily use any module that does this for us. Also, I do reject the notion that options are normal and arguments are not, e.g., see the classic UNIX utility cal(1). So, why do I insist on it:
Regarding the claim of that being non-standard, see cal(1) (by the way, the very first script called khal was a replacement for cal, because I disliked both cal's and ncal's output). But, as said before, I'm happy to have khal's commands either accept both, arguments and options, or have two sets of commands, one that accepts only options and one that accepts arguments. Quick anecdote only somewhat connected to any of this: Just today, a colleague of mine looked at scipy's current documentation for its Mann-Whitney-U Test (function signature: |
Arguments should be used for (1..n) parameters of the same type, options for optional parameters of different types. To see what I mean, look at
Cal is different since it takes a day, month, or year as argument, but at least one could argue that it takes a single "date" arg, with varying precision.
I'm going to interpret this as an argument for using keyword arguments everywhere. Coincidentally options are close to that :P I have an alternative idea:
|
I guess it wasn't important to me after all. Oh well. |
No description provided.