Add get and list for ruby

This commit is contained in:
Aoran Zeng 2023-09-02 15:45:37 +08:00
parent 71b06bb366
commit e2db2c18e1

27
chsrc.c
View File

@ -281,6 +281,24 @@ pl_ruby_setsrc (char* option)
xy_success(xy_2strjoin("chsrc: 感谢镜像提供方:", source_name));
}
void
pl_ruby_getsrc (char* option)
{
char* cmd = "gem sources";
xy_info (xy_2strjoin("chsrc: 运行 ", cmd));
system(cmd);
cmd = "bundle config get mirror.https://rubygems.org";
xy_info (xy_2strjoin("chsrc: 运行 ", cmd));
system(cmd);
}
void
pl_ruby_listsrc (char* option)
{
const mirror_info* mir = pl_ruby_sources->mirror;
printf ("%-18s%-41s ", mir->abbr, pl_ruby_sources->url);
puts(mir->name);
}
/**
@ -735,15 +753,6 @@ print_supported_targets ()
void
print_supported_sources_for_target (const char* target)
{
xy_info ("chsrc: 支持对以下目标换源 (同一行表示这几个命令兼容)");
}
int
print_help ()