(value string)
| 75 | } |
| 76 | |
| 77 | func normalizeAdminUserHashFunction(value string) (string, error) { |
| 78 | switch strings.ToLower(strings.TrimSpace(value)) { |
| 79 | case "": |
| 80 | return "", nil |
| 81 | case "md5": |
| 82 | return "MD5", nil |
| 83 | case "sha-1", "sha1": |
| 84 | return "SHA-1", nil |
| 85 | case "crypt": |
| 86 | return "crypt", nil |
| 87 | default: |
| 88 | return "", usage("invalid --hash-function (expected MD5, SHA-1, crypt)") |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func requireAdminAccount(flags *RootFlags) (string, error) { |
| 93 | account, err := requireAccount(flags) |
no test coverage detected