mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-29 06:01:21 +00:00
console: fix output, closes #93
This commit is contained in:
parent
3330cb4856
commit
36de70be10
@ -259,7 +259,7 @@ func cmdBatch(cmd *cobra.Command, args []string) {
|
|||||||
func cmdConsole(cmd *cobra.Command, args []string) {
|
func cmdConsole(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
fmt.Printf("\n> ")
|
fmt.Printf("> ")
|
||||||
bufReader := bufio.NewReader(os.Stdin)
|
bufReader := bufio.NewReader(os.Stdin)
|
||||||
line, more, err := bufReader.ReadLine()
|
line, more, err := bufReader.ReadLine()
|
||||||
if more {
|
if more {
|
||||||
@ -454,12 +454,16 @@ func printResponse(cmd *cobra.Command, args []string, rsp response) {
|
|||||||
fmt.Println(">", cmd.Use, strings.Join(args, " "))
|
fmt.Println(">", cmd.Use, strings.Join(args, " "))
|
||||||
}
|
}
|
||||||
|
|
||||||
if !rsp.Code.IsOK() {
|
// Always print the status code.
|
||||||
fmt.Printf("-> code: %s\n", rsp.Code.String())
|
fmt.Printf("-> code: %s\n", rsp.Code.String())
|
||||||
}
|
|
||||||
if len(rsp.Data) != 0 {
|
if len(rsp.Data) != 0 {
|
||||||
fmt.Printf("-> data: %s\n", rsp.Data)
|
// Do no print this line when using the commit command
|
||||||
fmt.Printf("-> data.hex: %X\n", rsp.Data)
|
// because the string comes out as gibberish
|
||||||
|
if cmd.Use != "commit" {
|
||||||
|
fmt.Printf("-> data: %s\n", rsp.Data)
|
||||||
|
}
|
||||||
|
fmt.Printf("-> data.hex: 0x%X\n", rsp.Data)
|
||||||
}
|
}
|
||||||
if rsp.Log != "" {
|
if rsp.Log != "" {
|
||||||
fmt.Printf("-> log: %s\n", rsp.Log)
|
fmt.Printf("-> log: %s\n", rsp.Log)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user