Skip to content

Commit b119584

Browse files
tashianclaude
andcommitted
Don't hardcode password flag in non-interactive error
Address review feedback: different commands use different password flags (--password-file, --provisioner-password-file, --admin-password-file, etc.), so don't suggest a specific flag. Instead, guide users to check --help for the correct flag for their command. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 095867f commit b119584

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/cmd/root.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,17 @@ func newApp(stdout, stderr io.Writer) *cli.App {
9898
pemutil.WriteFile = fileutil.WriteFile
9999
pemutil.PromptPassword = func(msg string) ([]byte, error) {
100100
if !ui.CanPrompt() {
101-
return nil, errs.NewRequiredInputError("password", "password-file")
101+
// Don't suggest a specific flag since different commands use different
102+
// password flags (--password-file, --provisioner-password-file, etc.)
103+
return nil, errs.NewRequiredInputError("password", "")
102104
}
103105
return ui.PromptPassword(msg)
104106
}
105107
jose.PromptPassword = func(msg string) ([]byte, error) {
106108
if !ui.CanPrompt() {
107-
return nil, errs.NewRequiredInputError("password", "password-file")
109+
// Don't suggest a specific flag since different commands use different
110+
// password flags (--password-file, --provisioner-password-file, etc.)
111+
return nil, errs.NewRequiredInputError("password", "")
108112
}
109113
return ui.PromptPassword(msg)
110114
}

0 commit comments

Comments
 (0)