From 26dc18b2c1faa0d284b579d6ed3ccf1d479e65d3 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 4 Apr 2015 20:22:53 +0000 Subject: [PATCH] Unify version command handlers. 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. --- command.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/command.c b/command.c index eac09f05..22948dbb 100644 --- a/command.c +++ b/command.c @@ -425,9 +425,10 @@ static int com_version(struct command_context *cc) 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); } -- 2.39.2