forked from lix-project/lix
Add a markdown output to nix describe-stores
This commit is contained in:
parent
b73adacc1e
commit
634cb2a5ae
|
@ -27,7 +27,16 @@ struct CmdDescribeStores : Command, MixJSON
|
||||||
if (json) {
|
if (json) {
|
||||||
std::cout << res;
|
std::cout << res;
|
||||||
} else {
|
} 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue