Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Jun 6, 2018
1 parent 7372e6b commit 019ffcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions tools/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const (
FlagPrintEventVersion = "print_event_version"
FlagPrintEventVersionWithAlias = FlagPrintEventVersion + ", pev"
FlagPrintFullyDetail = "print_full"
FlagPrintFullyDetailWithAlias = FlagPrintFullyDetail + ", full"
FlagPrintFullyDetailWithAlias = FlagPrintFullyDetail + ", pf"
FlagPrintRawTime = "print_raw_time"
FlagPrintRawTimeWithAlias = FlagPrintRawTime + ", prt"
FlagPrintDateTime = "print_datetime"
Expand Down Expand Up @@ -392,14 +392,7 @@ func showHistoryHelper(c *cli.Context, wid, rid string) {
for _, e := range history.Events {
columns := []string{}
if printFully {
jsonBs, err := json.Marshal(e)
var jsonStr string
if err != nil {
jsonStr = "ERROR!"
} else {
jsonStr = string(jsonBs)
}
columns = append(columns, jsonStr)
columns = append(columns, anyToString(e))
table.Append(columns)
continue
}
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func anyToString(d interface{}) string {
continue
}
if buf.Len() > 1 {
buf.WriteString(", ")
buf.WriteString(",")
}
fieldName := t.Field(i).Name
if fieldName == "Reason" || fieldName == "Details" || fieldName == "Cause" {
Expand Down

0 comments on commit 019ffcf

Please sign in to comment.