Skip to content

Commit 4d87560

Browse files
committed
审核完成:Python 命令行之旅:深入 click(四)
1 parent 74ec3e8 commit 4d87560

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

contents/Python/cmdline/click-5.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ def cmd1(color):
7474

7575
比如有一个命令行程序叫做 `foo-bar`,那么对应的环境变量名称为 `_FOO_BAR_COMPLETE`,然后在 `.bashrc` 中使用 `source` 导出即可:
7676

77-
````bash
77+
```bash
7878
eval "$(_FOO_BAR_COMPLETE=source foo-bar)"
79-
···
79+
```
8080

8181
或者在 `.zshrc` 中使用:
82+
8283
```bash
8384
eval "$(_FOO_BAR_COMPLETE=source_zsh foo-bar)"
84-
````
85+
```
8586

8687
不过上面的方式总是在命令行程序启动时调用,这可能在有多个程序时减慢 shell 激活的速度。另一种方式是把命令放在文件中,就像这样:
8788

0 commit comments

Comments
 (0)