Update help for CPAN in cpan shell

This commit is contained in:
XuehaiPan 2020-12-30 10:28:29 +08:00
parent 0fc2b36025
commit e798086f59

View File

@ -23,34 +23,37 @@ perl -MCPAN -e 'mkmyconfig'
在命令行中执行 `cpan` 进入 cpan shell
```
```shell
cpan shell -- CPAN exploration and modules installation
Enter 'h' for help.
# 列出当前的镜像设置
cpan[1]> o conf urllist
# 将本站镜像加入镜像列表顶部
# 将本站镜像加入镜像列表首位
# 注:若已在列表中则可跳过本步直接退出,修改列表不会执行自动去重
cpan[2]> o conf urllist unshift https://{{ site.hostname }}/CPAN/
# 或替换镜像列表,仅保留本站
cpan[3]> o conf urllist https://{{ site.hostname }}/CPAN/
# 或将本站镜像加入镜像列表末尾
# 注:本命令和上面的命令执行一个即可,修改列表不会执行自动去重
cpan[3]> o conf urllist push https://{{ site.hostname }}/CPAN/
# 保存配置至 MyConfig.pm
cpan[4]> o conf commit
# 或清空镜像列表,仅保留本站
cpan[4]> o conf urllist https://{{ site.hostname }}/CPAN/
# 保存修改后的配置至 MyConfig.pm
cpan[5]> o conf commit
# 退出 cpan shell
cpan[5]> quit
cpan[6]> quit
```
将本镜像加入到镜像列表的顶部
### 自动设置
### 在命令行中使用脚本设置
在命令行中执行:
```bash
# 若本站不在镜像列表中则将其加入列表顶部
# 若本站不在镜像列表中则将其加入列表首位
if ! (
perl -MCPAN -e 'CPAN::HandleConfig->load();' \
-e 'CPAN::HandleConfig->prettyprint("urllist")' |