From 7dbdc7cf101ff3ec186881663ff1801a28acf160 Mon Sep 17 00:00:00 2001 From: Self Not Found Date: Wed, 18 Oct 2023 18:47:32 +0800 Subject: [PATCH] Add short flag -m for timeout related commands --- client/src/cmdhw.c | 7 ++++--- client/src/preferences.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/cmdhw.c b/client/src/cmdhw.c index d47cec050..7483a07a9 100644 --- a/client/src/cmdhw.c +++ b/client/src/cmdhw.c @@ -931,13 +931,14 @@ static int CmdTimeout(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hw timeout", "Set the communication timeout on the client side", - "hw timeout --> Show current timeout\n" - "hw timeout --ms 500\n" + "hw timeout --> Show current timeout\n" + "hw timeout -m 20 --> Set the timeout to 20ms\n" + "hw timeout --ms 500 --> Set the timeout to 500ms\n" ); void *argtable[] = { arg_param_begin, - arg_int0(NULL, "ms", "", "timeout in micro seconds"), + arg_int0("m", "ms", "", "timeout in micro seconds"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); diff --git a/client/src/preferences.c b/client/src/preferences.c index cbdeb69f1..83deb945d 100644 --- a/client/src/preferences.c +++ b/client/src/preferences.c @@ -839,12 +839,13 @@ static int setClientTimeout(const char *Cmd) { CLIParserInit(&ctx, "prefs set client.timeout", "Set persistent preference of client communication timeout", "prefs set client.timeout --ms 0 --> unsets any timeout\n" - "prefs set client.timeout --ms 500\n" + "prefs set client.timeout -m 20 --> Set the timeout to 20ms\n" + "prefs set client.timeout --ms 500 --> Set the timeout to 500ms\n" ); void *argtable[] = { arg_param_begin, - arg_int0(NULL, "ms", "", "timeout in micro seconds"), + arg_int0("m", "ms", "", "timeout in micro seconds"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true);