Skip to content

Commit

Permalink
renamed beat command to heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
cvilsmeier committed Aug 17, 2024
1 parent dc2c641 commit 793baf8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
go-version: ['1.20', '1.21', '1.22']
go-version: ['1.21', '1.22', '1.23']

steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Commands
watchdog <watchdogId>
Get heartbeat watchdog by id.
beat <watchdogId> [interval]
heartbeat <watchdogId> [interval]
Send a heartbeat. If interval is not specified, moni sends
one heartbeat and exits. If interval is specified, moni
will stay in the background and send heartbeats in that
Expand Down Expand Up @@ -174,6 +174,10 @@ Exit Codes

## Changelog

### v0.2.2

- renamed beat command to heartbeat

### v0.2.1

- update values command docs
Expand Down
11 changes: 7 additions & 4 deletions moni.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

// Version is the moni tool version
const Version = "v0.2.1"
const Version = "v0.2.2"

// config flag definitions
const (
Expand Down Expand Up @@ -104,7 +104,7 @@ func usage() {
prt(" watchdog <watchdogId>")
prt(" Get heartbeat watchdog by id.")
prt("")
prt(" beat <watchdogId> [interval]")
prt(" heartbeat <watchdogId> [interval]")
prt(" Send a heartbeat. If interval is not specified, moni sends")
prt(" one heartbeat and exits. If interval is specified, moni")
prt(" will stay in the background and send heartbeats in that")
Expand Down Expand Up @@ -226,6 +226,9 @@ func main() {
flag.Parse()
// execute non-API commands
command := flag.Arg(0)
if command == "beat" {
log.Printf("WARNING: the 'beat' command is deprecated and will be removed in a future version. Please use the 'heartbeat' command instead.")
}
switch command {
case "", "help":
usage()
Expand Down Expand Up @@ -300,8 +303,8 @@ func main() {
fatal(1, "%s", err)
}
printWatchdogs([]monibot.Watchdog{watchdog})
case "beat":
// moni beat <watchdogId> [interval]
case "heartbeat":
// moni heartbeat <watchdogId> [interval]
watchdogId := flag.Arg(1)
if watchdogId == "" {
fatal(2, "empty watchdogId")
Expand Down

0 comments on commit 793baf8

Please sign in to comment.