add short names for root options

fix flag example in readme
This commit is contained in:
2025-06-03 12:33:37 +01:00
parent 89a5add7ad
commit 4446784709
3 changed files with 14 additions and 16 deletions

View File

@@ -18,8 +18,8 @@ func (v VersionFlag) Decode(_ *kong.DecodeContext) error { return nil }
func (v VersionFlag) IsBool() bool { return true }
// BeforeApply implements the kong.Flag interface for VersionFlag.
func (v VersionFlag) BeforeApply(app *kong.Kong, _ kong.Vars) error {
fmt.Println(version)
func (v VersionFlag) BeforeApply(app *kong.Kong, _ kong.Vars) error { // nolint: unparam
fmt.Printf("gobs-cli version: %s\n", version)
app.Exit(0) // Exit the application after printing the version
return nil
}