Skip to content
Snippets Groups Projects
Unverified Commit 810d94b4 authored by Mike Yuan's avatar Mike Yuan Committed by GitHub
Browse files

Merge pull request #34860 from enr0n/varlinkctl-fixes

Fix varlinkctl output with `--more`
parents 5ff6841c ebc8b9e4
No related branches found
No related tags found
No related merge requests found
......@@ -194,9 +194,9 @@ static int parse_argv(int argc, char *argv[]) {
assert_not_reached();
}
/* If more than one reply is expected, imply JSON-SEQ output */
/* If more than one reply is expected, imply JSON-SEQ output, and set SD_JSON_FORMAT_FLUSH */
if (FLAGS_SET(arg_method_flags, SD_VARLINK_METHOD_MORE))
arg_json_format_flags |= SD_JSON_FORMAT_SEQ;
arg_json_format_flags |= SD_JSON_FORMAT_SEQ|SD_JSON_FORMAT_FLUSH;
strv_sort_uniq(arg_graceful);
......@@ -539,8 +539,10 @@ static int verb_call(int argc, char *argv[], void *userdata) {
parameter = argc > 3 && !streq(argv[3], "-") ? argv[3] : NULL;
/* No JSON mode explicitly configured? Then default to the same as -j */
if (FLAGS_SET(arg_json_format_flags, SD_JSON_FORMAT_OFF))
arg_json_format_flags = SD_JSON_FORMAT_PRETTY_AUTO|SD_JSON_FORMAT_COLOR_AUTO;
if (FLAGS_SET(arg_json_format_flags, SD_JSON_FORMAT_OFF)) {
arg_json_format_flags &= ~SD_JSON_FORMAT_OFF;
arg_json_format_flags |= SD_JSON_FORMAT_PRETTY_AUTO|SD_JSON_FORMAT_COLOR_AUTO;
}
/* For pipeable text tools it's kinda customary to finish output off in a newline character, and not
* leave incomplete lines hanging around. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment