summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-04-24 15:14:49 +0200
committerPeter Wu <lekensteyn@gmail.com>2013-04-24 15:14:49 +0200
commit26ea52e92656abfa4449e6bb389a9177b2a96e83 (patch)
tree4af62c45122c3fcee11957326f7709acd80b11ad
parent69aadeb0d75a1a10ebcd4fd92bb71262d39523c9 (diff)
downloadltunify-26ea52e92656abfa4449e6bb389a9177b2a96e83.tar.gz
ltunify: put version info for receiver in "receiver-info"
-rw-r--r--ltunify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ltunify.c b/ltunify.c
index 70ec8ed..44b35e2 100644
--- a/ltunify.c
+++ b/ltunify.c
@@ -774,7 +774,6 @@ void get_and_print_recv_fw(int fd) {
if (get_device_versions(fd, DEVICE_RECEIVER, &version)) {
print_versions(&version);
- putchar('\n');
}
}
@@ -858,6 +857,7 @@ static void print_usage(const char *program_name) {
" default 0 which is an alias for 30s)\n"
" unpair idx - Unpair device\n"
" info idx - Show more detailled information for a device\n"
+" receiver-info - Show information about the receiver\n"
"In the above lines, \"idx\" refers to the device number shown in the\n"
" first column of the list command (between 1 and 6).\n"
, program_name, PACKAGE_VERSION);
@@ -901,7 +901,7 @@ static int validate_args(int argc, char **argv, char ***args, char **hidraw_path
args_count = argc - optind - 1;
cmd = (*args)[0];
- if (!strcmp(cmd, "list")) {
+ if (!strcmp(cmd, "list") || !strcmp(cmd, "receiver-info")) {
/* nothing to check */
} else if (!strcmp(cmd, "pair")) {
if (args_count >= 1) {
@@ -1065,11 +1065,11 @@ int main(int argc, char **argv) {
} else if (!strcmp(cmd, "info")) {
u8 device_index;
- get_and_print_recv_fw(fd);
-
device_index = (u8) strtoul(args[1], NULL, 0);
gather_device_info(fd, device_index);
print_detailed_device(device_index);
+ } else if (!strcmp(cmd, "receiver-info")) {
+ get_and_print_recv_fw(fd);
} else {
fprintf(stderr, "Unhandled command: %s\n", cmd);
goto end_notifs;