You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 090575a
Browse filesBrowse the repository at this point in the historyBrowse files
feat: self-correcting flag/command errors, global --fields, query window notes
Callers frequently guess flag and verb names by analogy with a sibling
command. The errors now carry the candidates, so the next call can be
right without a separate --help round trip:
- Unknown flag: lists the closest flag names, the command's own flags and
the global flags (root FlagErrorFunc, inherited by curated and generated
commands). Other flag errors pass through unchanged.
- Unknown command: suggests siblings, then single-record verb synonyms
(get/info/infos/detail), then any leaf in the whole tree whose path
contains the token on hyphen-token boundaries (`silence` ->
`channel silence-rule-list`, `monit-datasource` -> `monit datasource-list`),
and lists the level's commands. The check now runs before cobra
dispatch, so `<group> <typo> --help` errors instead of printing the
group's help and exiting 0.
- `--version` is accepted and prints the `version` line.
--fields is now a global output flag: json/toon output of any command is
projected to the named top-level fields (each row of a list, or the keys
of a single record), before the 16 KiB bound is applied. A name matching
no key is reported on stderr with the keys that exist; acknowledgements
and raw bodies print unchanged with a note; non-projectable shapes are an
error. Commands with their own --fields keep it.
Windowed queries announce on stderr the window they sent, in the local
timezone, with its span and its end relative to now
(`note: window ..(1h, ends in 7h)`), which makes a wrong default or a
timezone slip visible. This covers the curated windowed verbs,
monit-query's execution window, and generated --start-time/--end-time
pairs. `incident list` with only open --progress states and
`alert list --active` default to 30d instead of 24h when --since is not
given, since open records are often older than a day.
skilldoc: the dump now carries the root's flags; the validator checks the
flags of a bare `fduty --flag` example against them and takes global
flags from the dump instead of a hand-kept list.
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,9 @@ flashduty config set base_url URL # Override the API endpoint
124
124
|`--output-format`|`table` (default), `json`, or `toon`|
125
125
|`--json`| Alias for `--output-format json`|
126
126
|`--no-trunc`| Do not truncate long fields in table output |
127
+
|`--fields`| Keep only these comma-separated top-level fields in `json`/`toon` output: each row of a list, or the keys of a single record |
127
128
|`--base-url`| Override the API base URL |
129
+
|`--version`| Print the version (same as `flashduty version`) |
128
130
129
131
## Output formats
130
132
@@ -134,6 +136,10 @@ flashduty config set base_url URL # Override the API endpoint
134
136
135
137
Every structured list page is capped at 16 KiB. A page that had to be reduced is reported on stderr, and list envelopes also carry `"truncated": true` in the payload. With `"emitted_rows": N`, only the first N rows were returned: re-request with a smaller `--limit` until the rows you hold reach `total`. Without it, every row is present but long values were clipped: narrow `--fields`.
136
138
139
+
Commands that query a time range print the window they actually sent on stderr, in the local timezone, e.g. `note: window 2026-10-08T14:00:00+08:00..2026-10-09T14:00:00+08:00 (1d, ended now)`. stdout stays pure `json`/`toon`. `incident list --progress Triggered,Processing` and `alert list --active` default to the last 30 days when `--since` is not given, since open records can be older than a day.
140
+
141
+
An unknown flag or command error lists the closest valid names and the valid choices at that level.
Long: curatedLong("Search audit logs within a time window, optionally filtered by person, operation type, write/read, risk level and request ID. The --since/--until window must be < 90 days; --limit max is 99.", "AuditLogs", "Search"),
0 commit comments