aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2020-09-14 14:04:21 +0200
committerregnat <rg@regnat.ovh>2020-09-16 13:53:09 +0200
commit634cb2a5aec64164dd7fa9467d9cdb1569611c21 (patch)
tree622a22235302870d89e4474428a9873183914e12 /src/nix
parentb73adacc1ebda8a790cd8e0b0988c3b0607d947a (diff)
Add a markdown output to `nix describe-stores`
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/describe-stores.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/nix/describe-stores.cc b/src/nix/describe-stores.cc
index 027187bd9..0cc2d9337 100644
--- a/src/nix/describe-stores.cc
+++ b/src/nix/describe-stores.cc
@@ -27,7 +27,16 @@ struct CmdDescribeStores : Command, MixJSON
if (json) {
std::cout << res;
} else {
- throw Error("Only json is available for describe-stores");
+ 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;
+ }
+ }
}
}
};