-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be5607c
commit fda9cb7
Showing
9 changed files
with
108 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,70 @@ | ||
# 命令行界面 | ||
|
||
本软件除了图形界面(Graphical User Interface, GUI)外,还提供了命令行界面(Command Line Interface, CLI)。当图形界面不适用,或者需要批量配置时,CLI 模式便能派上用场。 | ||
|
||
## 如何使用 CLI | ||
|
||
当程序未接收到任何命令行参数时,将默认使用 GUI。如果你在启动程序时,传递了额外的命令行参数,则程序会改为使用 CLI(启用 `--gui` 开关除外)。 | ||
|
||
因此,你可以使用 `--cli` 参数来启动本程序,这样便会使用 CLI。 | ||
|
||
```sh | ||
./vscch --cli | ||
``` | ||
|
||
> `--cli` 参数没有任何作用,单纯是为了破坏“未接收到任何命令行参数”的状态。 | ||
此外,如果 Windows 系统下没有安装 WebView 2 运行时,程序也将退化到 CLI。 | ||
|
||
## 交互模式与非交互模式 | ||
|
||
CLI 具体细分为两种模式:_交互模式_(Interactive mode)与 _非交互模式_(Non-interactive mode)。 | ||
|
||
它们的具体区别是,如果软件需要用户提供更多的信息,_交互模式_ 下会以提示符(Prompt)的形式询问并获得用户输入;而 _非交互模式_ 下则会得到运行时错误并终止程序。总之,_交互模式_ 更适合用户直接运行,而 _非交互模式_ 适合批处理、定时计划等场景。 | ||
|
||
默认的模式是 _交互模式_。传入 `-y` 或 `--assume-yes` 参数来启用 _非交互模式_。 | ||
|
||
## 交互模式使用说明 | ||
|
||
> 注:以下用户输入都可以通过传递命令行参数来跳过。 | ||
### VS Code 选择 | ||
|
||
请首先输入 VS Code 可执行文件的路径。如果工具检测到了已有的 VS Code 安装,则默认值已经就绪,直接回车下一步即可。 | ||
|
||
### 编译器类型选择 | ||
|
||
按上、下键选择你想要使用的编译器类型;按回车确定。 | ||
|
||
### 编译器路径选择 | ||
|
||
如果当前类型的编译器有且只有一个安装,则这一步骤会被跳过。 | ||
|
||
否则,从已安装的编译器中选择你想要使用的,或者进行如下操作之一: | ||
|
||
- **获取新的编译器**:查看编译器安装说明,并引导你安装(若可用)。 | ||
- **填写新的编译器路径**:输入新的编译器路径(比如通过“获取新的编译器”步骤下载并解压得到的)。 | ||
- **重新扫描**:重新检查已安装的编译器(比如刚刚通过“获取新的编译器”步骤安装了新的编译器)。 | ||
|
||
### 工作文件夹 | ||
|
||
输入工作文件夹路径;不合法(如 MinGW-w64 下的中文路径)时工具会提示。 | ||
|
||
### 等待配置完成 | ||
|
||
工具会按照你提供的信息,并以默认设置完成配置。CLI 模式下,工具不会自动启动 VS Code;你需要手动打开工作文件夹并测试配置效果。 | ||
|
||
## 非交互模式使用说明 | ||
|
||
你需要在启动程序时使用以下参数: | ||
|
||
| 参数名 | | 含义 | | ||
| ----------------- | ---- | -------------------------------------------- | | ||
| `-y` | 必需 | 启用非交互模式 | | ||
| `-w <PATH>` | 必需 | 指定工作文件夹路径 | | ||
| `-v` | 建议 | 启用更多输出;越多越具体(如 `-vvv`) | | ||
| `-s <SETUP_NAME>` | 可选 | 指定编译器类型;可通过 `--help` 获得类型名称 | | ||
| `-c <PATH>` | 可选 | 指定编译器路径;若编译器不存在或不唯一则报错 | | ||
| `--vscode <PATH>` | 可选 | 指定 VS Code 路径;若未安装则报错 | | ||
|
||
更多的参数说明请参考[配置选项说明](./options)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
# 配置选项说明 | ||
|
||
## GUI/CLI 通用选项 | ||
|
||
|
||
|
||
## 其它 CLI 选项 | ||
|
||
### 显示版本信息 `-V` `--version` | ||
|
||
显示版本信息并退出。 | ||
|
||
### 显示帮助信息 `-h` `--help` | ||
|
||
显示本文档的简单版本并退出。按 CLI 选项的字典序排序。 | ||
|
||
### 使用图形界面 `-g` `--gui` | ||
|
||
当启用此开关时,将启动图形界面,且所有其它选项均被忽略,以下选项除外: | ||
- 日志相关(`-v` `-q` `-L`) | ||
- 跳过扩展管理(`--skip-ext-manage`) | ||
|
||
### 跳过扩展管理 `--skip-ext-manage` | ||
|
||
启用此开关后,扩展管理步骤将被跳过。此选项仅用于调试、诊断软件本身,不应在正常运行时使用。 | ||
|
||
### 启用 CLI `--cli` | ||
|
||
此开关无作用。 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters