Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cmd/auth/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ func promptForProfile(ctx context.Context, defaultValue string) (string, error)
Label: "Databricks profile name [" + defaultValue + "]",
})
if result == "" {
// Manually return the default value. We could use the prompt.Default
// field, but be inconsistent with other prompts in the CLI.
return defaultValue, err
}
return result, err
Expand Down
9 changes: 3 additions & 6 deletions cmd/selftest/tui/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ import (

func newPromptCmd() *cobra.Command {
var (
defaultVal string
mask bool
validate bool
mask bool
validate bool
)
cmd := &cobra.Command{
Use: "prompt",
Short: "cmdio.RunPrompt (single-line text input)",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
opts := cmdio.PromptOptions{
Label: "Enter a value",
Default: defaultVal,
Label: "Enter a value",
}
if mask {
opts.Mask = '*'
Expand All @@ -47,7 +45,6 @@ func newPromptCmd() *cobra.Command {
return nil
},
}
cmd.Flags().StringVar(&defaultVal, "default", "", "pre-fill the input with this value")
cmd.Flags().BoolVar(&mask, "mask", false, "echo input as '*'")
cmd.Flags().BoolVar(&validate, "validate", false, "require '://' in input")
return cmd
Expand Down
4 changes: 0 additions & 4 deletions libs/cmdio/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ type PromptOptions struct {
// Label is shown before the input field. Required.
Label string

// Default is the value pre-filled in the input field.
Default string

// Mask, when non-zero, replaces typed characters with the given rune
// (use '*' for password-style input).
Mask rune
Expand All @@ -31,7 +28,6 @@ func RunPrompt(ctx context.Context, opts PromptOptions) (string, error) {
c := fromContext(ctx)
p := promptui.Prompt{
Label: opts.Label,
Default: opts.Default,
Mask: opts.Mask,
HideEntered: opts.HideEntered,
Validate: opts.Validate,
Expand Down
Loading