فهرست منبع

kamctl: catch one line jsonrpc result and just print it

- happening when json pretty printing is turned off
- filter_json() was breaking it by trying to format the output
Daniel-Constantin Mierla 8 سال پیش
والد
کامیت
e4226212f5
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      utils/kamctl/kamctl.base

+ 1 - 0
utils/kamctl/kamctl.base

@@ -682,6 +682,7 @@ filter_json()
 	$AWK 'function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
 	$AWK 'function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
 		BEGIN { line=0; IGNORECASE=1; }
 		BEGIN { line=0; IGNORECASE=1; }
 		{ line++; }
 		{ line++; }
+		NR == 1 && /^{.+"id"[ \t]*:[ \t]*[0-9]+[ \t]*}$/ { print; next; }
 		NR == 1 && /^200 OK/ { next; }
 		NR == 1 && /^200 OK/ { next; }
 		/^[ \t]*"jsonrpc":[ \t]*"2.0"/ { print; next; }
 		/^[ \t]*"jsonrpc":[ \t]*"2.0"/ { print; next; }
 		/^[ \t]*"result":[ \t]*\[.+/ {
 		/^[ \t]*"result":[ \t]*\[.+/ {