Skip to content

Commit

Permalink
Fix version information
Browse files Browse the repository at this point in the history
  • Loading branch information
mAdkins committed May 24, 2023
1 parent d1603e1 commit d656fbf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,8 @@ This scenario handles two problems:
| `-version` | `bool` | Show version of application |
| `-help` | `bool` | Show usage and flags |

Boolean flags (e.g. `-fileAppend` and `-help`) do not require a value.
Boolean flags (e.g. `-version` and `-help`) do not require a value.
The presence of such a flag indicates a value of `true`.
In the case of `-version`, which defaults to `true`,
it is necessary to specify `-version=false` to turn it off.

Format values can be set separately for console output and optional log file.

Expand Down
2 changes: 1 addition & 1 deletion tester/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewSet() *Set {
set.StringVar(&set.logFileFormat, "fileFormat", logging.FmtDefault, "Log file format")
set.UintVar(&set.maxFieldLen, "maxFieldLen", 32, "Maximum length of fields to display")
set.BoolVar(&set.logMsgTwice, "logMsgTwice", false, "Log each message twice with tester in the middle")
set.BoolVar(&set.version, "version", true, "Show lsp-tester version")
set.BoolVar(&set.version, "version", false, "Show lsp-tester version")
return set
}

Expand Down
7 changes: 2 additions & 5 deletions tester/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"net"
"os"
"runtime/debug"
Expand Down Expand Up @@ -112,9 +111,9 @@ func logVersion() {
case "vcs.revision":
event.Str("Revision", setting.Value)
case "vcs.time":
event.Str("When", setting.Value)
event.Str("Revised", setting.Value)
case "vcs.modified":
event.Str("Dirty", setting.Value)
event.Str("Modified", setting.Value)
}
}
if target != "" && arch != "" {
Expand All @@ -125,7 +124,5 @@ func logVersion() {
if target != "" {
event.Str("Target", target).Msg("Version")
}

fmt.Print(info)
}
}

0 comments on commit d656fbf

Please sign in to comment.