Skip to content

Commit

Permalink
Fix CLI version print (#509)
Browse files Browse the repository at this point in the history
There was a slight drift and it was printing:
```
martinkysel@mac xmtpd (main) $ ./dev/cli --version
Version: unknown
```

```
martinkysel@mac xmtpd (main) $ ./dev/cli --version
Version: v0.2.0-0-g8ffc98e

```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Updated the command-line interface to display version information
using a more standardized label for improved clarity and consistency.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
mkysel authored Feb 19, 2025
1 parent f2e6eba commit a1f9ba5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"go.uber.org/zap"
)

var Commit string = "unknown"
var Version string = "unknown"

type CLI struct {
config.GlobalOptions
Expand Down Expand Up @@ -264,7 +264,7 @@ func updateAddress(logger *zap.Logger, options *CLI) {
func main() {
for _, arg := range os.Args[1:] {
if arg == "-v" || arg == "--version" {
fmt.Printf("Version: %s\n", Commit)
fmt.Printf("Version: %s\n", Version)
return
}
}
Expand Down

0 comments on commit a1f9ba5

Please sign in to comment.