Skip to content
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

chore: fix the output of etcdctl watch -i #19397

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
4 changes: 2 additions & 2 deletions etcdctl/ctlv3/command/watch_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

args := Argify(l)
if len(args) < 1 {
fmt.Fprintf(os.Stderr, "Invalid command: %s (watch and progress supported)\n", l)
fmt.Fprintf(os.Stderr, "Invalid command: %s (only `watch` and `progress` supported)\n", l)

Check warning on line 108 in etcdctl/ctlv3/command/watch_command.go

View check run for this annotation

Codecov / codecov/patch

etcdctl/ctlv3/command/watch_command.go#L108

Added line #L108 was not covered by tests
continue
}
switch args[0] {
Expand All @@ -131,7 +131,7 @@
cobrautl.ExitWithError(cobrautl.ExitError, err)
}
default:
fmt.Fprintf(os.Stderr, "Invalid command %s (only support watch)\n", l)
fmt.Fprintf(os.Stderr, "Invalid command %s (only support `watch` & `progress`)\n", l)

Check warning on line 134 in etcdctl/ctlv3/command/watch_command.go

View check run for this annotation

Codecov / codecov/patch

etcdctl/ctlv3/command/watch_command.go#L134

Added line #L134 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to suggest having the same message in both places for consistency (and use the opportunity to improve the grammar :). i.e.,

Suggested change
fmt.Fprintf(os.Stderr, "Invalid command %s (only support `watch` & `progress`)\n", l)
fmt.Fprintf(os.Stderr, `Invalid command %s (only "watch" and "progress" are supported)\n`, l)

And apply the same to line 108.

continue
}
}
Expand Down