para_audiod's version command supports the -v flag, but the one of
para_server does not and always prints the full version text. This
adds the -v flag to the server command and makes it behave identical
to its counterpart.
char *msg;
size_t len;
- if (cc->argc != 1)
- return -E_COMMAND_SYNTAX;
- len = xasprintf(&msg, "%s", version_text("server"));
+ if (cc->argc > 1 && strcmp(cc->argv[1], "-v") == 0)
+ len = xasprintf(&msg, "%s", version_text("server"));
+ else
+ len = xasprintf(&msg, "%s\n", version_single_line("server"));
return send_sb(&cc->scc, msg, len, SBD_OUTPUT, false);
}