From 22796c723d0d7ba89d3b0d82e726896d5c8116b0 Mon Sep 17 00:00:00 2001 From: SourLemonJuice Date: Tue, 18 Jun 2024 02:08:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3,=E4=B8=8E?= =?UTF-8?q?=E6=A0=87=E5=BF=97=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 标志更改是指这个: --mode argument -> arguments --- README.md | 15 +++++++++------ source/main.c | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fe1d43b..bf6327d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ You can run it with `--help` to get all flags.\ um... In simplest case, it looked like... ```text -$ ./i18nglish.out -- hello world +$ ./i18nglish.out --mode arguments hello world h3o w3d ``` @@ -48,11 +48,14 @@ h3o w3d ```text $ ./i18nglish.out --help -All flags/arguments are unstable. ---help | --version | -- <...> | --source_file | --stdin -``` +NOTE: Flags are just half stable +Usage: i18nglish [--version] [--help] --mode [args] -NOTE: All flags are unstable. +MODE(for set input source): + arguments Use all arguments after it + file Read a text file + stdin Same 'file' but use stdin +``` ### Precautions @@ -62,7 +65,7 @@ Although there is no **word**(separated with `space` and `\n`) as long as this. Only use for ASCII(single char type) characters, don't do this: ```shell -./i18nglish.out -- — 或者这种字符串 +./i18nglish.out --mode arguments 这种字符串 或者 — ``` If it happened, I wouldn't care of them.\ diff --git a/source/main.c b/source/main.c index 3725727..20d07af 100644 --- a/source/main.c +++ b/source/main.c @@ -193,8 +193,8 @@ int parseCliFlag(struct AppCliFlagConfig *flag_data, int argc, char *argv[]) return AppExitGetFlagError; } - // argument - if (strcmp(argv[i], "argument") == 0) { + // arguments + if (strcmp(argv[i], "arguments") == 0) { flag_data->main_mode = AppInputMode_ParseArgument; i++; if (i + 1 <= argc) { @@ -247,7 +247,7 @@ int main(int argc, char *argv[]) printf("NOTE: Flags are just half stable\n"); printf("Usage: i18nglish [--version] [--help] --mode [args]\n"); printf("\nMODE(for set input source):\n"); - printf("\targument\tUse all arguments after it\n"); + printf("\targuments\tUse all arguments after it\n"); printf("\tfile \tRead a text file\n"); printf("\tstdin\tSame 'file' but use stdin\n"); exit(AppExitOk);