From a52b7a19855fd2ba36497b533a91472ebfa0059a Mon Sep 17 00:00:00 2001 From: Jim Ramsay Date: Sun, 8 Jan 2023 12:15:50 -0500 Subject: [PATCH] Add description and argument help to wayvnc --help Signed-off-by: Jim Ramsay --- src/main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 8ee7a15..cd7b883 100644 --- a/src/main.c +++ b/src/main.c @@ -907,7 +907,13 @@ void on_capture_done(struct screencopy* sc) int wayvnc_usage(struct option_parser* parser, FILE* stream, int rc) { - fprintf(stream, "Usage: wayvnc [options] [address [port]]\n\n"); + static const char* usage = +"Usage: wayvnc [options] [
[]]\n" +"\n" +"Starts a VNC server for $WAYLAND_DISPLAY"; + fprintf(stream, "%s\n\n", usage); + if (option_parser_print_arguments(parser, stream)) + fprintf(stream, "\n"); option_parser_print_options(parser, stream); fprintf(stream, "\n"); return rc; @@ -1263,8 +1269,10 @@ int main(int argc, char* argv[]) int log_level = NVNC_LOG_WARNING; static const struct wv_option opts[] = { - { .positional = "address" }, - { .positional = "port" }, + { .positional = "address", + .help = "The IP address or unix socket path to listen on. Default: 127.0.0.1" }, + { .positional = "port", + .help = "The TCP port to listen on. Default: 5900" }, { 'C', "config", "", "Select a config file." }, { 'g', "gpu", NULL,