examples: Add more flexibility to set verbosity

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-09-08 19:04:08 +02:00
parent 607dad040b
commit c55140272f

View File

@@ -148,6 +148,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
ssh_bind sshbind = state->input; ssh_bind sshbind = state->input;
static int no_default_keys = 0; static int no_default_keys = 0;
static int rsa_already_set = 0, ecdsa_already_set = 0; static int rsa_already_set = 0, ecdsa_already_set = 0;
static int verbosity = 0;
switch (key) switch (key)
{ {
@@ -176,8 +177,10 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
strncpy(authorizedkeys, arg, DEF_STR_SIZE - 1); strncpy(authorizedkeys, arg, DEF_STR_SIZE - 1);
break; break;
case 'v': case 'v':
ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_LOG_VERBOSITY_STR, verbosity++;
"3"); ssh_bind_options_set(sshbind,
SSH_BIND_OPTIONS_LOG_VERBOSITY,
&verbosity);
break; break;
case ARGP_KEY_ARG: case ARGP_KEY_ARG:
if (state->arg_num >= 1) if (state->arg_num >= 1)