From 231a08ce19572890a721399870e8d608e33466f4 Mon Sep 17 00:00:00 2001 From: Jim Ramsay Date: Sat, 5 Nov 2022 22:42:24 -0400 Subject: [PATCH] Clarify the various wayvncctl 'help' modes Signed-off-by: Jim Ramsay --- src/ctl-client.c | 1 + src/wayvncctl.c | 17 +++++++++-------- wayvncctl.scd | 41 ++++++++++++++++++++++++++++++----------- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/ctl-client.c b/src/ctl-client.c index 7f1a169..bfcbe88 100644 --- a/src/ctl-client.c +++ b/src/ctl-client.c @@ -296,6 +296,7 @@ static void print_help(json_t* data) json_string_value(param_value)); } } + printf("\nRun 'wayvncctl --help' for allowed Options\n"); } } diff --git a/src/wayvncctl.c b/src/wayvncctl.c index 12cfecf..dbd9535 100644 --- a/src/wayvncctl.c +++ b/src/wayvncctl.c @@ -46,16 +46,17 @@ static int wayvncctl_usage(FILE* stream, int rc) static const char* usage = "Usage: wayvncctl [options] [command [--param1=value1 ...]]\n" "\n" -"Connects to and interacts with a running wauvnc instance." +"Connects to and interacts with a running wayvnc instance." "\n" -"Try the \"help\" command for a list of available commands.\n" +"Try 'wayvncctl help' for a list of available commands.\n" "\n" -" -S,--socket= Wayvnc control socket path.\n" -" -j,--json Output json on stdout.\n" -" Default: $XDG_RUNTIME_DIR/wayvncctl\n" -" -V,--version Show version info.\n" -" -v,--verbose Be more verbose.\n" -" -h,--help Get help (this text).\n" +"Options:\n" +" -S,--socket= Wayvnc control socket path.\n" +" -j,--json Output json on stdout.\n" +" Default: $XDG_RUNTIME_DIR/wayvncctl\n" +" -V,--version Show version info.\n" +" -v,--verbose Be more verbose.\n" +" -h,--help Get help (this text).\n" "\n"; fprintf(stream, "%s", usage); diff --git a/wayvncctl.scd b/wayvncctl.scd index d00ac3b..4650935 100644 --- a/wayvncctl.scd +++ b/wayvncctl.scd @@ -2,7 +2,7 @@ wayvncctl(1) # NAME -wayvncctl - A control client for wayvnc(1) +wayvncctl - A command line control lient for wayvnc(1) # SYNOPSIS @@ -24,7 +24,8 @@ wayvncctl - A control client for wayvnc(1) Be more verbose. *-h, --help* - Get help. + Get help about the wayvncctl command itself (lists these options). Does + not connect to the wayvncctl control socket. # DESCRIPTION @@ -32,12 +33,18 @@ wayvncctl - A control client for wayvnc(1) This command line utility provides easy interaction with those commands. For a full list of currently supported commands, see -*wayvnc(1)* section _IPC COMMANDS_, or use the +*wayvnc(1)* section _IPC COMMANDS_, or run the *wayvncctl help* command. +Running *wayvncctl help* contacts the server over the control socket and returns +a list of the available commands. + +Running *wayvncctl command-name --help* returns a description of the server-side +command and its available parameters. + # EXAMPLES -Query the server for all available command names: +Query the server for all available IPC command names: ``` $ wayvncctl help @@ -49,23 +56,35 @@ Allowed commands: Run 'wayvncctl command-name --help' for command-specific details. ``` -Get help on the "help" command: +Get help on the "set-output" IPC command: ``` -$ wayvncctl help --help -Usage: wayvncctl [options] help [params] +$ wayvncctl set-output --help +Usage: wayvncctl [options] set-output [params] -List all commands, or show usage of a specific command +Switch the actively captured output Parameters: - --command=... - The command to show (optional) + --switch-to=... + The specific output name to capture + + --cycle=... + Either "next" or "prev" + +Run 'wayvncctl --help' for allowed options ``` Cycle to the next active output: ``` -$ wayvncctl set-output --cycle=forward +$ wayvncctl set-output --cycle=next +``` + +Get json-formatted version information: + +``` +$ wayvncctl --json version +{"wayvnc":"v0.5.0","neatvnc":"v0.5.1","aml":"v0.2.2"} ``` # ENVIRONMENT