Accept a bare integer as seconds for watchpr --interval #11

Merged
benvin merged 1 commits from benvin/watchpr-interval-units into main 2026-09-09 22:42:25 +10:00
Member

watchpr --interval 15 was rejected by flag parsing and exited non-zero immediately, which is indistinguishable from a watcher firing on a change — an operator believed a watcher was running when it had never started.

  • accept a bare integer as seconds, keeping duration strings (15s, 2m, 1h30m)
  • reject unparseable and non-positive values with an error naming the flag and showing valid forms
`watchpr --interval 15` was rejected by flag parsing and exited non-zero immediately, which is indistinguishable from a watcher firing on a change — an operator believed a watcher was running when it had never started. - accept a bare integer as seconds, keeping duration strings (`15s`, `2m`, `1h30m`) - reject unparseable and non-positive values with an error naming the flag and showing valid forms
unkin-agent added 1 commit 2026-09-09 22:38:20 +10:00
Accept a bare integer as seconds for watchpr --interval
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
71e42811fb
- add agent.ParseDurationFlag: bare integer means seconds, duration strings still parse
- take --interval as a string and parse it in the command
- reject unparseable and non-positive values with an error naming the flag
benvin merged commit 7c6ec361ae into main 2026-09-09 22:42:25 +10:00
benvin deleted branch benvin/watchpr-interval-units 2026-09-09 22:42:26 +10:00
Sign in to join this conversation.