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

Also print version when running ./sail-operator version #438

Merged
merged 1 commit into from
Oct 18, 2024
Merged
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
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
opts.BindFlags(flag.CommandLine)
flag.Parse()

if printVersion {
if printVersion || flag.NArg() > 0 && flag.Arg(0) == "version" {

Check warning on line 68 in cmd/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/main.go#L68

Added line #L68 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Since version is a more standard way, may be we can just support version alone (and remove printVersion)?

Copy link
Contributor

Choose a reason for hiding this comment

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

aah okay, so its not printVersion its "--version". Got it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, printVersion is tied to --version, which is also standard, so I think we should just keep both so that whatever the user uses works.

fmt.Println(version.Info)
os.Exit(0)
}
Expand Down