Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "otp <secret>", Short: "Generate OTP code from TOTP secret", Args: cobra.ExactArgs(1), Run: func(c *cobra.Command, args []string) { code, err := totp.GenerateCode(args[0], time.Now()) if err != nil { log.Fatal("Error generating OTP: ", err) } if FlagWithDash { fmt.Printf("%s-%s\n", code[:3], code[3:]) } else { fmt.Println(code) } }, }
View Source
var FlagWithDash bool
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.