result->matches = i9e_complete_commands(ci->word, audiod_completers);
}
+static void version_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ char *opts[] = {"-v", NULL};
+
+ if (ci->word_num <= 2 && ci->word && ci->word[0] == '-')
+ i9e_complete_option(opts, ci, cr);
+}
+
static void stat_completer(struct i9e_completion_info *ci,
struct i9e_completion_result *cr)
{
D: terminate audiod
U: term
H: Stop all decoders, shut down connection to para_server and exit.
+---
+N: version
+D: print the version of para_audiod
+U: version [-v]
+H: If the -v option is given, a more detailed version text is printed.
#include "string.h"
#include "write.h"
#include "fd.h"
+#include "version.h"
#include "audiod_command_list.h"
extern struct sched sched;
return 1;
}
+static int com_version(int fd, int argc, char **argv)
+{
+ int ret;
+ char *msg;
+
+ if (argc > 1 && strcmp(argv[1], "-v") == 0)
+ msg = make_message("%s", version_text("audiod"));
+ else
+ msg = make_message("%s\n", version_single_line("audiod"));
+ ret = client_write(fd, msg);
+ free(msg);
+ if (ret >= 0)
+ close(fd);
+ return ret;
+}
+
static int check_perms(uid_t uid)
{
int i;