runLegacyInit executes the original non-interactive initialization
(force bool, mode string, seedTTL int, algorithm string, digits int)
| 83 | |
| 84 | // runLegacyInit executes the original non-interactive initialization |
| 85 | func runLegacyInit(force bool, mode string, seedTTL int, algorithm string, digits int) { |
| 86 | // Default to touchid if mode not specified |
| 87 | if mode == "" { |
| 88 | mode = "touchid" |
| 89 | } |
| 90 | |
| 91 | // 根据模式选择初始化方式 |
| 92 | switch mode { |
| 93 | case "touchid": |
| 94 | initTouchIDMode(force) |
| 95 | case "otp": |
| 96 | initOTPMode(force, seedTTL, algorithm, digits) |
| 97 | default: |
| 98 | fatal(fmt.Errorf("不支持的认证模式: %s (支持 touchid 或 otp)", mode)) |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func cmdImport() { |
| 103 | fs := flag.NewFlagSet("import", flag.ExitOnError) |
no test coverage detected