When calling a method and the user hasn't provided any method call
parameters on the command line we expect them on stdin instead. This
might be confusing for people using varlinkctl for the first time, since
omitting the parameters will just throw you at a blinking cursor.
Let's be a bit more helpful, and show a friendly message when we are
connected to a TTY (i.e. run interactively).
if (r < 0)
return log_error_errno(r, "Failed to parse parameters at <argv[4]>:%u:%u: %m", line, column);
} else {
+ if (isatty(STDIN_FILENO) > 0 && !arg_quiet)
+ log_notice("Expecting method call parameter JSON object on standard input.");
+
r = sd_json_parse_file_at(stdin, AT_FDCWD, "<stdin>", 0, &jp, &line, &column);
if (r < 0)
return log_error_errno(r, "Failed to parse parameters at <stdin>:%u:%u: %m", line, column);