Title: feat(cli): relative-time flags on generated commands' unix-seconds timestamps by ysyneu · Pull Request #47 · flashcatcloud/flashduty-cli · GitHub
Open Graph Title: feat(cli): relative-time flags on generated commands' unix-seconds timestamps by ysyneu · Pull Request #47 · flashcatcloud/flashduty-cli
X Title: feat(cli): relative-time flags on generated commands' unix-seconds timestamps by ysyneu · Pull Request #47 · flashcatcloud/flashduty-cli
Description: What
Generated CLI commands forced raw unix integers on their time flags, while curated commands (incident list --since/--until) accepted ergonomic relative time (7d, now, dates). This closes that inconsistency — part of the generated-as-single-source convergence (Phase 2, after #46's generic table renderer).
Every unix-SECONDS timestamp flag on a generated command now accepts:
a duration — 7d, 24h (= now minus that)
+7d for the future
now
a date / datetime / RFC3339
raw unix seconds (back-compatible — the old int form still works)
…parsed at runtime via timeutil.Parse, the exact logic curated commands already use.
How
The generator (internal/cmd/cligen) detects unix-seconds timestamp fields and emits a string flag + a genParseTimeFlag pre-parse instead of an int flag. Detection is deliberately precise so it never corrupts a non-timestamp int:
Field kind
Example
Treated as
Why
unix-seconds timestamp
start_time, end_time, start, end, *_at_*_seconds
relative-time string
a point in time
millisecond timestamp
RUM/sourcemap/webhook start_time
stays int64
Parse yields seconds → 1000× wrong
duration
delay_seconds, seconds_to_ack
stays int64
a count of seconds, not a point in time
Beyond the description-keyword signal (unix/epoch + second), two name conventions catch fields the spec under-documents — eliminating asymmetric start/end pairs:
bare start/end window boundaries (schedule list --start was prose-only)
the
Open Graph Description: What Generated CLI commands forced raw unix integers on their time flags, while curated commands (incident list --since/--until) accepted ergonomic relative time (7d, now, dates). This closes that ...
X Description: What Generated CLI commands forced raw unix integers on their time flags, while curated commands (incident list --since/--until) accepted ergonomic relative time (7d, now, dates). This closes that ...
Opengraph URL: https://github.com/flashcatcloud/flashduty-cli/pull/47
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9e4324f4-9043-1e86-ee29-bf3079fd7dde |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9502:323A96:160EE0B:201C033:6A4E4936 |
| html-safe-nonce | 659038d0eb20fd7ca75855ca972cccffaeee5f43da9aa5ec4883a5cffa3bea8f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTAyOjMyM0E5NjoxNjBFRTBCOjIwMUMwMzM6NkE0RTQ5MzYiLCJ2aXNpdG9yX2lkIjoiMzg5MjQwNTM5NDcyMzQ1NzMzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b0a960381b7beb9edf1f9d5b67d5cdc2fbc0d1d6f92fa770918ce0ca28efb714 |
| hovercard-subject-tag | pull_request:3866477355 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/flashcatcloud/flashduty-cli/pull/47/files |
| twitter:image | https://avatars.githubusercontent.com/u/9045284?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9045284?s=400&v=4 |
| og:image:alt | What Generated CLI commands forced raw unix integers on their time flags, while curated commands (incident list --since/--until) accepted ergonomic relative time (7d, now, dates). This closes that ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/flashcatcloud/flashduty-cli git https://github.com/flashcatcloud/flashduty-cli.git |
| octolytics-dimension-user_id | 90465697 |
| octolytics-dimension-user_login | flashcatcloud |
| octolytics-dimension-repository_id | 1209147161 |
| octolytics-dimension-repository_nwo | flashcatcloud/flashduty-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1209147161 |
| octolytics-dimension-repository_network_root_nwo | flashcatcloud/flashduty-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e8506f6d0538364886e3f0153c154c410965e70d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width