summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-08-15 23:31:37 +0200
committerJakob Unterwurzacher2018-08-15 23:31:37 +0200
commitbd054e70ef1c0f9709b5bc216ba148cf088d7edb (patch)
tree0cef30f59c72082d20fa361567b1cc0ef1cd0413 /main.go
parent7771a33f659420b76b5f49eeda80b3f6d7728425 (diff)
trezor: show support in version string
Show enable_trezor in the version string if we were compiled with `-tags enable_trezor`. And hide the `-trezor` flag from the help output if we were not.
Diffstat (limited to 'main.go')
-rw-r--r--main.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/main.go b/main.go
index f423cd1..26d09f5 100644
--- a/main.go
+++ b/main.go
@@ -129,16 +129,23 @@ func changePassword(args *argContainer) {
// printVersion prints a version string like this:
// gocryptfs v0.12-36-ge021b9d-dirty; go-fuse a4c968c; 2016-07-03 go1.6.2
func printVersion() {
- buildFlags := ""
+ var tagsSlice []string
if stupidgcm.BuiltWithoutOpenssl {
- buildFlags = " without_openssl"
+ tagsSlice = append(tagsSlice, "without_openssl")
+ }
+ if readpassword.TrezorSupport {
+ tagsSlice = append(tagsSlice, "enable_trezor")
+ }
+ tags := ""
+ if tagsSlice != nil {
+ tags = " " + strings.Join(tagsSlice, " ")
}
built := fmt.Sprintf("%s %s", BuildDate, runtime.Version())
if raceDetector {
built += " -race"
}
fmt.Printf("%s %s%s; go-fuse %s; %s\n",
- tlog.ProgramName, GitVersion, buildFlags, GitVersionFuse, built)
+ tlog.ProgramName, GitVersion, tags, GitVersionFuse, built)
}
func main() {