mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09:00
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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user