Artifacts Associated With Ticket cd25761979
Ticket change [6263d0a915] (rid 229573) by oehhar on 2024-07-25 12:52:45:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Ashok wrote the following message on the core list: <verbatim> % clock scan now 1721803544 % clock format now bad seconds "now": must be -now or integer % clock format -now </verbatim> The above seems incongruous to me, why -now for format and “now” for scan? Afaict, “-now” is really a value, not an option. And unlike options, it cannot appear at arbitrary points in the command, only in place of the time value. Is there a rationale for the difference? If no, is it too late to change for 9.0? If too late for compatibility reasons, can clock format and clock add treat “now” and “-now” as synonyms with latter deprecated? (With a TIP of course)
- foundin initialized to: "main"
- is_private initialized to: "0"
- login: "oehhar"
- priority initialized to: "5 Medium"
- private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "oehhar"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "clock command - "now" vs "-now""
- type initialized to: "Bug"
Ticket change [631ace5738] (rid 229574) by oehhar on 2024-07-25 12:58:16:
- icomment:
Ashok, great to find that. The TIP [https://core.tcl-lang.org/tips/doc/trunk/tip/688.md] only writes about "-now" not "now". Thanks for branch [b5e6612557] I am also with you, that just "now" looks nicer. Thank you, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [2bedf6d09e] (rid 229583) by sebres on 2024-07-26 19:02:29:
- icomment:
The new clock engine introduces new pseudo seconds value as quasi "option" `-now`, as a replacement for `[clock seconds]` supplied as a base. This is also described in the TIP. `clock scan now` is a free-scan form (without format) what was always able to parse "word" `now`... this has indirectly nothing to do with the `-now` "option" (which is normally applicable for `clock format` or `clock add`). `clock scan` always uses base `-now` by default, but it can be surely supplied with `-base` parameter additionally (although doesn't make sense, because as already said by default it is now): ``` % clock scan "+1 month" -base -now 1724623200 % clock scan "+1 month" 1724623200 % clock scan "now +1 month" 1724623200 % clock scan "tomorrow +1 month" 1724709600 ``` Just note that only free-scan form of `clock scan` accepts `now` (or `tomorrow` or whatever). Anyway both have nothing to do with each others (one is a base value to format, add etc, another is a user input to scan). <blockquote>> Afaict, “-now” is really a value, not an option.</blockquote> Well, matter of taste probably. One can consider it as an option so that then commands `clock add` and `clock format` don't need a value (value becomes optional in that case). However, I'm not against can to treat `now` and `-now` as synonyms (no idea it'd need a TIP again). But please without further deprecation of `-now`.
- login: "sebres"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [4db3239309] (rid 229584) by oehhar on 2024-07-27 12:25:12:
- icomment:
Sergey, thank you for the explanation. That makes sense. I hope, I did not disturb you within your holidays... Thanks again, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [12c3a2b47d] (rid 229585) by sbron on 2024-07-27 19:56:44:
- icomment:
I have to disagree. It doesn't make sense. The `[clock format]` command takes one argument indicating which time value to format. Allowing some symbolic name to serve as a shorthand for the frequently used value `[clock seconds]` is useful. But that symbolic name still represents a value. So it should just be a simple symbolic name, like "now". It shouldn't be a "quasi" option that needs to be in a specific position and then disallows providing the value argument. (The statement that *value* becomes optional is not true. If both are provided, an error is thrown.) Why introduce such a complicated set of rules when it could suffice to say that "the word 'now' may be used for *timeVal* to mean the current time". So I definitely would say that "now" should at least be accepted in all the places where "-now" has recently been introduced. I also think that "-now" should be deprecated as soon as possible, because we should get rid of things that are not logical. In my opinion, "-now" deserves that qualification.
- login: "sbron"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [9c9b86e7eb] (rid 229586) by apnadkarni on 2024-07-28 16:48:34:
- icomment:
I'm with Schelte on this one for exactly the reasons he described. It doesn't matter what the context for usage; in the user's mind it refers to current time and having to remember where to use "now" and where to use "-now" is unnecessary and confusing. If "-now" needs to be maintained as a synonym for some reason (compatibility with 9.0 beta releases?) we can just leave it undocumented.
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [5e62e0bbde] (rid 229595) by sebres on 2024-07-28 19:52:15:
- closedate changed to: "2460520.32795339"
- closer changed to: "sebres"
- icomment:
Fixed in [f602e32fc37910d1] for 8.7+, value <code>-now</code> retained to compat reasons to earlier versions and tclclockmod, but undocumented at the moment (excepting the TIP).
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"