nix describe-stores: Remove
This command was intended for docs generation, but it was never used for that and we don't need it.
This commit is contained in:
parent
8d6d59cb1b
commit
7704118d28
|
@ -26,4 +26,6 @@
|
|||
```shell-session
|
||||
$ nix path-info /nix/store/gzaflydcr6sb3567hap9q6srzx8ggdgg-glibc-2.33-78.drv^*
|
||||
```
|
||||
provides information about each of its outputs.
|
||||
provides information about each of its outputs.
|
||||
|
||||
* The command `nix describe-stores` has been removed.
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
#include "command.hh"
|
||||
#include "common-args.hh"
|
||||
#include "shared.hh"
|
||||
#include "store-api.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using namespace nix;
|
||||
|
||||
struct CmdDescribeStores : Command, MixJSON
|
||||
{
|
||||
std::string description() override
|
||||
{
|
||||
return "show registered store types and their available options";
|
||||
}
|
||||
|
||||
Category category() override { return catUtility; }
|
||||
|
||||
void run() override
|
||||
{
|
||||
auto res = nlohmann::json::object();
|
||||
for (auto & implem : *Implementations::registered) {
|
||||
auto storeConfig = implem.getConfig();
|
||||
auto storeName = storeConfig->name();
|
||||
res[storeName]["settings"] = storeConfig->toJSON();
|
||||
}
|
||||
if (json) {
|
||||
logger->cout("%s", res);
|
||||
} else {
|
||||
for (auto & [storeName, storeConfig] : res.items()) {
|
||||
std::cout << "## " << storeName << std::endl << std::endl;
|
||||
for (auto & [optionName, optionDesc] : storeConfig.items()) {
|
||||
std::cout << "### " << optionName << std::endl << std::endl;
|
||||
std::cout << optionDesc["description"].get<std::string>() << std::endl;
|
||||
std::cout << "default: " << optionDesc["defaultValue"] << std::endl <<std::endl;
|
||||
if (!optionDesc["aliases"].empty())
|
||||
std::cout << "aliases: " << optionDesc["aliases"] << std::endl << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static auto rDescribeStore = registerCommand<CmdDescribeStores>("describe-stores");
|
|
@ -1,8 +0,0 @@
|
|||
source common.sh
|
||||
|
||||
# Query an arbitrary value in `nix describe-stores --json`'s output just to
|
||||
# check that it has the right structure
|
||||
[[ $(nix --experimental-features 'nix-command flakes' describe-stores --json | jq '.["SSH Store"]["compress"]["defaultValue"]') == false ]]
|
||||
|
||||
# Ensure that the output of `nix describe-stores` isn't empty
|
||||
[[ -n $(nix --experimental-features 'nix-command flakes' describe-stores) ]]
|
|
@ -115,7 +115,6 @@ nix_tests = \
|
|||
db-migration.sh \
|
||||
bash-profile.sh \
|
||||
pass-as-file.sh \
|
||||
describe-stores.sh \
|
||||
nix-profile.sh \
|
||||
suggestions.sh \
|
||||
store-ping.sh \
|
||||
|
|
Loading…
Reference in a new issue