diff --git a/src/varlinkctl/varlinkctl.c b/src/varlinkctl/varlinkctl.c index f88a1050934fe585531cbd259ab4b384a7b0a037..f204b0f3c947e917042194302d3d46b9b6cff455 100644 --- a/src/varlinkctl/varlinkctl.c +++ b/src/varlinkctl/varlinkctl.c @@ -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. */