-
Notifications
You must be signed in to change notification settings - Fork 250
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
cmdline entry format improvements #465
Comments
Not so bad because the current format has never been thoroughly described :-) Also, the description parsing after comma doesn't seem to work at all in hamster 2.2.2, so I don't see a regression there. We could also define the format like this:
where "description and tags" would be just free-form input from which hamster would pick all #words prefixed with #hash as #tags. That would include tags at the beginning, at the end, or actually anywhere after the first word. Thus:
would define an activity "#boss" in category "meeting" with description "In this meeting I asked for higher salary and more days_off" and tags "salary" and "days_off". This should be parseable just fine. In general, I'd recommend against making this configurable. This is GNOME - avoid possibly confusing configuration options. |
A nitpick, but how about I suggest choosing something that is similar to past practice (but not necessarily 100% compatible), convenient for entry and simple to define and parse. Define the behaviour in a wiki page as the standard, then stick to it. It will be impossible to please everyone. I am also not in favor of the further complexity of configurable separators. |
OK, we'll discuss that after v3.0. And description without category does not work for command line indeed (surprise), |
activity: "#boss", category: None, description "I'm asking for higher salary", tags: "salary". |
@GeraldJansen, did you mean this?
I would treat these two as equivalent (or IOW, the comma as optional). Someone will complain that it's impossible to enter activities that end with ",", but hey, forget about it. |
@mwilck My main point is that current usage is not well defined and my example could mean different things depending on the rules. Even the rule @ederag Just for the record, here's what the Gnome extension readme currently says:
|
Obviously. Not at all. What gave the impression otherwise ? |
Obviously a wrong impression. Comment cancelled. |
Spaces in the activity name? Excuse me, I'm an old-fashioned command line guy, this would never have occurred to me. All my propositions are based on the assumption that spaces are not allowed in either activity, tag, or category names. Without that, hell is open. If we want to be anything like consistent, we must either forbid spaces, or forbid To reiterate an example I've been using before - Twitter allows no spaces in hash tags. So forbidding them should be a rule that even total command-line haters should be able to grasp. |
I use multi-word activity names with spaces all the time and they have been a normal part of Hamster forever. Concerning requiring quotation for spaces in activity names, NO thanks! |
Ok, that clarifies it. That means, of course, that indeed |
Just to make sure I understand right, @GeraldJansen, you would parse the example
As just an activity named " |
Yes. An @category would be required before any description or tags. Dates and times would be parsed and removed from the front, then anything up to @ would be the activity name. I assume that people that use tags and descriptions also usually use categories, so this would not be a burden. |
Is it the case ? Some users might like to use tags only, |
Okay, my suggestion was just that, a suggestion. You and others may have better solutions. |
@GeraldJansen Maybe this time, we'll see. |
@ederag Actually I haven't yet understood your proposal. With the current spec in wiki/Entering-activities, i.e. |
Indeed, it looks like a special separator will be required before tags too, |
@GeraldJansen, does whitespace have to be supported in tag and category names, too? |
@mwilck IMO there should not be spaces in categories or tags, but I am not sure about the behaviour of the current parser. Perhaps @ederag can clarify. My own categories have the form "client/project" and I then use |
I tried the code from #461. Spaces in category work, but hell breaks loose if you try spaces in tag names. Basically, doing that will cause no tags to be recognized any more, and the tag string to be added to the "description" field. |
You're in the territory of "undefined behaviour" ;-) |
The current code is what "determines" the behavior. But you're right, it's undocumented and it has never been thoroughly defined. |
Is it really worth all this effort and complexity to allow commas in activity names? Why don't you just close #280? We don't want our users to have to learn and memorize complex syntax rules for entering certain characters. The rules have to be simple, and "comma is forbidden" is simple, even if some don't like it. |
Related issue: #285. |
Two additional constraints:
in #476 (review).
OK, I have an experimental parser that does the job with fixed separators, |
Proposition in PR #482. |
There have been requests for a more permissive parser (#280, #423)
and different suggestions such as
activity name[@category[, description] [#tag1] ... [#tagn]]
in #438 (comment), or
name[@Category] [#tag1] [#tag2] ... [description]
in #438 (comment).
My current opinion is that there is no way to have a smart parser
using heuristics suitable for almost any input.
This is even more difficult as this parser should keep
the currently satisfied users experience intact.
Both the above suggestions do not keep compatibility.
The first one because it would not be possible to enter
activity, description
without category.The second one because description would now be at the end.
Another issue with the second one is that it would prevent entering a description starting with
#
.So the plan could be to make all separators configurable, such as
,,
before description.Regular expressions could be allowed.
The defaults would not change, so most people would not even notice.
The text was updated successfully, but these errors were encountered: