Add description and argument help to wayvnc --help

Signed-off-by: Jim Ramsay <i.am@jimramsay.com>
wayvncctl-polishing
Jim Ramsay 2023-01-08 12:15:50 -05:00
parent 405e9a13df
commit a52b7a1985
1 changed files with 11 additions and 3 deletions

View File

@ -907,7 +907,13 @@ void on_capture_done(struct screencopy* sc)
int wayvnc_usage(struct option_parser* parser, FILE* stream, int rc) 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] [<address> [<port>]]\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); option_parser_print_options(parser, stream);
fprintf(stream, "\n"); fprintf(stream, "\n");
return rc; return rc;
@ -1263,8 +1269,10 @@ int main(int argc, char* argv[])
int log_level = NVNC_LOG_WARNING; int log_level = NVNC_LOG_WARNING;
static const struct wv_option opts[] = { static const struct wv_option opts[] = {
{ .positional = "address" }, { .positional = "address",
{ .positional = "port" }, .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", "<path>", { 'C', "config", "<path>",
"Select a config file." }, "Select a config file." },
{ 'g', "gpu", NULL, { 'g', "gpu", NULL,