commit fcf8cd3a0b283c2815d1c9eda52b7be87702ba26 parent 082d06f7e872d368ec03a183f09efdcf52bc2987 Author: Sean Enck <sean@ttypty.com> Date: Mon, 9 Jun 2025 15:45:24 -0400 use slices to do this check Diffstat:
| M | internal/app/totp.go | | | 5 | +---- |
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/internal/app/totp.go b/internal/app/totp.go @@ -67,10 +67,7 @@ func (w totpWrapper) generateCode() (string, error) { } func (args *TOTPArguments) display(opts TOTPOptions) error { - interactive := true - if args.Mode == commands.TOTPMinimal || args.Mode == commands.TOTPSeed || args.Mode == commands.TOTPURL { - interactive = false - } + interactive := !slices.Contains([]string{commands.TOTPMinimal, commands.TOTPSeed, commands.TOTPURL}, args.Mode) once := args.Mode == commands.TOTPOnce clipMode := args.Mode == commands.TOTPClip if !interactive && clipMode {