mirror of https://github.com/coder/coder.git
fix: fix cliui prompt styling (#11899)
This commit is contained in:
parent
207328ca50
commit
f572e18144
|
@ -71,9 +71,9 @@ func Prompt(inv *clibase.Invocation, opts PromptOptions) (string, error) {
|
||||||
} else {
|
} else {
|
||||||
renderedNo = Bold(ConfirmNo)
|
renderedNo = Bold(ConfirmNo)
|
||||||
}
|
}
|
||||||
pretty.Fprintf(inv.Stdout, DefaultStyles.Placeholder, "(%s/%s) ", renderedYes, renderedNo)
|
_, _ = fmt.Fprintf(inv.Stdout, "(%s/%s) ", renderedYes, renderedNo)
|
||||||
} else if opts.Default != "" {
|
} else if opts.Default != "" {
|
||||||
_, _ = fmt.Fprint(inv.Stdout, pretty.Sprint(DefaultStyles.Placeholder, "("+opts.Default+") "))
|
_, _ = fmt.Fprintf(inv.Stdout, "(%s) ", pretty.Sprint(DefaultStyles.Placeholder, opts.Default))
|
||||||
}
|
}
|
||||||
interrupt := make(chan os.Signal, 1)
|
interrupt := make(chan os.Signal, 1)
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ func (r *RootCmd) restart() *clibase.Cmd {
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = cliui.Prompt(inv, cliui.PromptOptions{
|
_, err = cliui.Prompt(inv, cliui.PromptOptions{
|
||||||
Text: "Confirm restart workspace?",
|
Text: "Restart workspace?",
|
||||||
IsConfirm: true,
|
IsConfirm: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -84,7 +84,7 @@ func TestRestart(t *testing.T) {
|
||||||
|
|
||||||
matches := []string{
|
matches := []string{
|
||||||
ephemeralParameterDescription, ephemeralParameterValue,
|
ephemeralParameterDescription, ephemeralParameterValue,
|
||||||
"Confirm restart workspace?", "yes",
|
"Restart workspace?", "yes",
|
||||||
"Stopping workspace", "",
|
"Stopping workspace", "",
|
||||||
"Starting workspace", "",
|
"Starting workspace", "",
|
||||||
"workspace has been restarted", "",
|
"workspace has been restarted", "",
|
||||||
|
@ -138,7 +138,7 @@ func TestRestart(t *testing.T) {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
matches := []string{
|
matches := []string{
|
||||||
"Confirm restart workspace?", "yes",
|
"Restart workspace?", "yes",
|
||||||
"Stopping workspace", "",
|
"Stopping workspace", "",
|
||||||
"Starting workspace", "",
|
"Starting workspace", "",
|
||||||
"workspace has been restarted", "",
|
"workspace has been restarted", "",
|
||||||
|
|
Loading…
Reference in New Issue