From bd054e70ef1c0f9709b5bc216ba148cf088d7edb Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 15 Aug 2018 23:31:37 +0200 Subject: 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. --- cli_args.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cli_args.go') diff --git a/cli_args.go b/cli_args.go index 114a27e..dd00658 100644 --- a/cli_args.go +++ b/cli_args.go @@ -12,6 +12,7 @@ import ( "github.com/rfjakob/gocryptfs/internal/configfile" "github.com/rfjakob/gocryptfs/internal/exitcodes" "github.com/rfjakob/gocryptfs/internal/prefer_openssl" + "github.com/rfjakob/gocryptfs/internal/readpassword" "github.com/rfjakob/gocryptfs/internal/stupidgcm" "github.com/rfjakob/gocryptfs/internal/tlog" ) @@ -152,7 +153,9 @@ func parseCliOpts() (args argContainer) { flagSet.BoolVar(&args.sharedstorage, "sharedstorage", false, "Make concurrent access to a shared CIPHERDIR safer") flagSet.BoolVar(&args.devrandom, "devrandom", false, "Use /dev/random for generating master key") flagSet.BoolVar(&args.fsck, "fsck", false, "Run a filesystem check on CIPHERDIR") - flagSet.BoolVar(&args.trezor, "trezor", false, "Protect the masterkey using a SatoshiLabs Trezor instead of a password") + if readpassword.TrezorSupport { + flagSet.BoolVar(&args.trezor, "trezor", false, "Protect the masterkey using a SatoshiLabs Trezor instead of a password") + } // Mount options with opposites flagSet.BoolVar(&args.dev, "dev", false, "Allow device files") -- cgit v1.2.3