From 0a7179380a341f849f51ccfde5019d22f9e2be1f Mon Sep 17 00:00:00 2001 From: youmetme <321640253@qq.com> Date: Tue, 30 Sep 2025 10:16:42 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=AF=B9=E9=BD=90=E5=92=8C=E5=8F=82=E6=95=B0=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ArgParse.c | 6 +++--- tests/initArgParse.h | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/ArgParse.c b/src/ArgParse.c index 8d5f60d..0839806 100644 --- a/src/ArgParse.c +++ b/src/ArgParse.c @@ -819,9 +819,9 @@ bool argParseCheckCommandTriggered(ArgParse *argParse, char *command_name) { } NORETURN void argParseError(ArgParse *argParse, - Command *lastCommand, - const char *prefix, - const char *suffix) { + Command *lastCommand, + const char *prefix, + const char *suffix) { if (argParse == NULL) { printf("ERROR: Parse is NULL\n"); exit(1); diff --git a/tests/initArgParse.h b/tests/initArgParse.h index d3379fb..119f530 100644 --- a/tests/initArgParse.h +++ b/tests/initArgParse.h @@ -4,7 +4,7 @@ #include ArgParse *initArgParse() { - ArgParse *argparse = argParseInit("测试程序",ArgParseNOVALUE); + ArgParse *argparse = argParseInit("测试程序", ArgParseNOVALUE); Command *command = NULL; Command *sub_command = NULL; @@ -17,12 +17,23 @@ ArgParse *initArgParse() { NULL, false, ArgParseNOVALUE); - argParseAddGlobalArg( - argparse, "-q", "--quiet", "Quiet mode", NULL, NULL, false, ArgParseNOVALUE); + argParseAddGlobalArg(argparse, + "-q", + "--quiet", + "Quiet mode", + NULL, + NULL, + false, + ArgParseNOVALUE); // add arguments - command = argParseAddCommand( - argparse, "install", "Install the package", NULL, NULL, NULL, ArgParseNOVALUE); + command = argParseAddCommand(argparse, + "install", + "Install the package", + NULL, + NULL, + NULL, + ArgParseNOVALUE); argParseAddArg(command, "-i", "--index", @@ -48,8 +59,13 @@ ArgParse *initArgParse() { false, ArgParseMULTIVALUE); - sub_command = argParseAddSubCommand( - command, "tools", "Install tools", NULL, NULL, NULL, ArgParseMULTIVALUE); + sub_command = argParseAddSubCommand(command, + "tools", + "Install tools", + NULL, + NULL, + NULL, + ArgParseMULTIVALUE); argParseAddArg(sub_command, "-t", @@ -59,8 +75,13 @@ ArgParse *initArgParse() { NULL, true, ArgParseMULTIVALUE); - sub_command = argParseAddSubCommand( - command, "tools_sub", "Install tools", NULL, NULL, NULL, ArgParseMULTIVALUE); + sub_command = argParseAddSubCommand(command, + "tools_sub", + "Install tools", + NULL, + NULL, + NULL, + ArgParseMULTIVALUE); argParseAddArg(sub_command, "-s",