feat(cli): show yanked binary variants in listings
This commit is contained in:
1 parent
4e5bdab8cd
commit
349ec257f5
8 files changed
+44
-11
No files matched your search
+8
-4
@@ -1175,8 +1175,9 @@ int execute_binaries_command(std::string_view sub, const BinariesCmdOptions &opt
|
||||
}
|
||||
|
||||
Package::RegistryAuth auth{Void::Configuration::get_env_or(opts.token_env, "")};
|
||||
auto variants =
|
||||
Package::fetch_binary_variants(registry_url, *opts.name_arg, *opts.version_arg, auth);
|
||||
// Listing shows yanked variants (marked); fetch below only resolves non-yanked ones.
|
||||
auto variants = Package::fetch_binary_variants(registry_url, *opts.name_arg, *opts.version_arg,
|
||||
auth, sub == "list");
|
||||
if (!variants) {
|
||||
std::cerr << "vbs binaries: " << variants.error().message() << '\n';
|
||||
return 1;
|
||||
@@ -1185,8 +1186,11 @@ int execute_binaries_command(std::string_view sub, const BinariesCmdOptions &opt
|
||||
if (sub == "list") {
|
||||
for (const auto &variant : *variants) {
|
||||
std::cout << variant.variant_id << ' ' << variant.sha256 << ' ' << variant.size_bytes
|
||||
<< ' ' << ((variant.signature && variant.public_key) ? "signed" : "unsigned")
|
||||
<< '\n';
|
||||
<< ' ' << ((variant.signature && variant.public_key) ? "signed" : "unsigned");
|
||||
if (variant.yanked) {
|
||||
std::cout << " yanked";
|
||||
}
|
||||
std::cout << '\n';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user