diff --git a/cli_test.go b/cli_test.go index f9cf6c4..d44891e 100644 --- a/cli_test.go +++ b/cli_test.go @@ -17,10 +17,9 @@ import ( func call(t *testing.T, cmd string) string { var output strings.Builder - stdout = func(a ...any) (int, error) { + stdout = func(a ...any) { output.WriteString(fmt.Sprint(a...)) output.WriteString("\n") - return 0, nil } err := app.Run(t.Context(), strings.Split(cmd, " ")) require.NoError(t, err) diff --git a/helpers.go b/helpers.go index a4f8a86..8110b23 100644 --- a/helpers.go +++ b/helpers.go @@ -424,7 +424,7 @@ func askConfirmation(msg string) bool { } defer tty.Close() - fmt.Fprintf(os.Stderr, color.YellowString(msg)) + log(color.YellowString(msg)) answer, err := tty.ReadString() if err != nil { return false diff --git a/helpers_key.go b/helpers_key.go index b06fb8c..c4fff11 100644 --- a/helpers_key.go +++ b/helpers_key.go @@ -139,7 +139,7 @@ func askPassword(msg string, shouldAskAgain func(answer string) bool) (string, e defer tty.Close() for { // print the prompt to stderr so it's visible to the user - fmt.Fprintf(os.Stderr, color.YellowString(msg)) + log(color.YellowString(msg)) // read password from TTY with masking password, err := tty.ReadPassword() diff --git a/mcp.go b/mcp.go index 5ab4250..bbf1062 100644 --- a/mcp.go +++ b/mcp.go @@ -169,7 +169,7 @@ var mcpServer = &cli.Command{ l++ pm, _ := sdk.ParseMetadata(result.Event) res.WriteString(fmt.Sprintf("\n\nResult %d\nUser name: \"%s\"\nPublic key: \"%s\"\nDescription: \"%s\"\n", - l, pm.ShortName, pm.PubKey.Hex(), pm.About)) + l, pm.ShortName(), pm.PubKey.Hex(), pm.About)) if l >= int(limit) { break