8000 feat(cli): add local and UTC time options to `ping` cmd by dannykopping · Pull Request #16648 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat(cli): add local and UTC time options to ping cmd #16648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 24, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Renaming
Signed-off-by: Danny Kopping <danny@coder.com>
  • Loading branch information
dannykopping committed Feb 24, 2025
commit 3d2d0bfa95f3870df6273c2af87f2d4513e24c0f
9 changes: 5 additions & 4 deletions cli/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import (

"github.com/coder/pretty"

"github.com/coder/serpent"

"github.com/coder/coder/v2/cli/cliui"
"github.com/coder/coder/v2/cli/cliutil"
"github.com/coder/coder/v2/coderd/util/ptr"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/healthsdk"
"github.com/coder/coder/v2/codersdk/workspacesdk"
"github.com/coder/serpent"
)

type pingSummary struct {
Expand Down Expand Up @@ -86,7 +87,7 @@ func (r *RootCmd) ping() *serpent.Command {
pingNum int64
pingTimeout time.Duration
pingWait time.Duration
pingTime bool
pingTimeLocal bool
pingTimeUTC bool
appearanceConfig codersdk.AppearanceConfig
)
Expand Down Expand Up @@ -275,7 +276,7 @@ func (r *RootCmd) ping() *serpent.Command {
}

var displayTime string
if pingTime || pingTimeUTC {
if pingTimeLocal || pingTimeUTC {
displayTime = pretty.Sprintf(cliui.DefaultStyles.DateTimeStamp, "[%s] ", pongTime.Format(time.RFC3339))
}

Expand Down Expand Up @@ -336,7 +337,7 @@ func (r *RootCmd) ping() *serpent.Command {
{
Flag: "time",
Description: "Show the response time of each pong in local time.",
Value: serpent.BoolOf(&pingTime),
Value: serpent.BoolOf(&pingTimeLocal),
},
{
Flag: "utc",
Expand Down
Loading
0