diff --git a/hexagonrpcd/hexagonrpcd.1 b/hexagonrpcd/hexagonrpcd.1 index 54c77bb..05add18 100644 --- a/hexagonrpcd/hexagonrpcd.1 +++ b/hexagonrpcd/hexagonrpcd.1 @@ -4,6 +4,8 @@ hexagonrpcd - Server for FastRPC remote procedure calls from Qualcomm DSPs .SH SYNOPSIS \fBhexagonrpcd\fP [\fIoptions\&.\&.\&.\fP] -f \fIDEVICE +.PP +\fBhexagonrpcd\fP -h .SH DESCRIPTION Server for FastRPC remote procedure calls from Qualcomm DSPs\&. .PP @@ -25,6 +27,9 @@ Root directory of served files (default: /usr/share/qcom/) .TP \fB\-s\fP Attach to sensorspd +.TP +\fB\-h\fP +Print help and exit .PP .SH NOTES diff --git a/hexagonrpcd/rpcd.c b/hexagonrpcd/rpcd.c index 38d5c00..600237b 100644 --- a/hexagonrpcd/rpcd.c +++ b/hexagonrpcd/rpcd.c @@ -77,7 +77,8 @@ static void print_usage(const char *argv0) "\t-f DEVICE\tFastRPC device node to attach to\n" "\t-p PROGRAM\tRun client program with shared file descriptor\n" "\t-R DIR\t\tRoot directory of served files (default: /usr/share/qcom/)\n" - "\t-s\t\tAttach to sensorspd\n"); + "\t-s\t\tAttach to sensorspd\n" + "\t-h\t\tPrint help and exit\n"); } static int create_shell_pd(int fd, const char *create_shell) @@ -372,7 +373,7 @@ int main(int argc, char* argv[]) if (guessed_device_dir != NULL) device_dir = guessed_device_dir; - while ((opt = getopt(argc, argv, "c:d:f:p:R:s")) != -1) { + while ((opt = getopt(argc, argv, "c:d:f:p:R:sh")) != -1) { switch (opt) { case 'c': create_shell = optarg; @@ -393,6 +394,10 @@ int main(int argc, char* argv[]) case 's': attach_sns = true; break; + case 'h': + print_usage(argv[0]); + goto free_pids; + break; default: print_usage(argv[0]); goto err_free_pids; @@ -438,6 +443,7 @@ int main(int argc, char* argv[]) terminate_clients(n_progs, pids); close(fd); +free_pids: free(pids); free(progs);