#registries #cargo #cargo-subcommand #alternative #command-line #cli

bin+lib cargo-reg

此插件扩展了 Cargo,允许您通过修改 .cargo/config 文件来管理替代注册表。

2 个版本

使用旧的 Rust 2015

0.1.1 2018 年 5 月 15 日
0.1.0 2018 年 5 月 11 日

#609Cargo 插件

Apache-2.0/MIT

19KB
325 行代码(不包括注释)

cargo-reg

此工具扩展了 cargo,允许您通过修改 .cargo/config 文件来管理替代注册表。

安装

$ cargo install cargo-reg

用法

cargo-reg
This command allows you to manage alternative registries in .cargo/config file.

USAGE:
    cargo-reg [FLAGS] [SUBCOMMAND]

FLAGS:
    -g, --global     Operate on a global config
    -h, --help       Prints help information
    -l, --local      Operate on a local config only
    -V, --version    Prints version information
    -v, --verbose    Verbose mode.

SUBCOMMANDS:
    add       Add a new `<ALIAS> => <INDEX_URL>`
    get       Get <INDEX_URL> by <ALIAS>
    help      Prints this message or the help of the given subcommand(s)
    list      Print the current configuration
    rename    Rename an existing <ALIAS>
    rm        Remove an existing <ALIAS>
    set       Set a new <INDEX_URL> by <ALIAS>

示例

$ cargo-reg --global add test1 https://test1-global.io
$ cargo-reg --global add test2 https://test2-global.io
$ cargo-reg --global list
test1 => https://test1-global.io
test2 => https://test2-global.io
$ cat ~/.cargo/config
[registries]
test1 = "https://test1-global.io"
test2 = "https://test2-global.io"
$
$ cd $SOME_DIR
$ cargo-reg add test1 https://test1-local.io
$ cargo-reg --local list
test1 => https://test1-local.io
$ cat $PWD/.cargo/config
[registries]
test1 = "https://test1-local.io"
$
$ cargo-reg list
test1 => https://test1-local.io
test2 => https://test2-global.io

许可证

您可以选择以下任一许可证进行授权:

依赖关系

约 7-14MB
约 175K 行代码(额外行数)