Skip to content

Commit

Permalink
更新文档,与标志更改
Browse files Browse the repository at this point in the history
标志更改是指这个:
--mode argument -> arguments
  • Loading branch information
SourLemonJuice committed Jun 17, 2024
1 parent 1801568 commit 22796c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,22 @@ 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
```

#### All flags/arguments

```text
$ ./i18nglish.out --help
All flags/arguments are unstable.
--help | --version | -- <string> <...> | --source_file <filePath> | --stdin
```
NOTE: Flags are just half stable
Usage: i18nglish [--version] [--help] --mode <MODE> [args]
NOTE: All flags are unstable.
MODE(for set input source):
arguments Use all arguments after it
file <path> Read a text file
stdin Same 'file' but use stdin
```

### Precautions

Expand All @@ -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.\
Expand Down
6 changes: 3 additions & 3 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -247,7 +247,7 @@ int main(int argc, char *argv[])
printf("NOTE: Flags are just half stable\n");
printf("Usage: i18nglish [--version] [--help] --mode <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 <path>\tRead a text file\n");
printf("\tstdin\tSame 'file' but use stdin\n");
exit(AppExitOk);
Expand Down

0 comments on commit 22796c7

Please sign in to comment.