1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Rename nix show-config to nix config show

Part of #7672
This commit is contained in:
Théophane Hufschmitt 2023-11-27 19:41:30 +01:00
parent f0180487a0
commit f300e11b05
6 changed files with 45 additions and 15 deletions

View file

@ -7,11 +7,31 @@
using namespace nix;
struct CmdShowConfig : Command, MixJSON
struct CmdConfig : virtual NixMultiCommand
{
CmdConfig() : MultiCommand(RegisterCommand::getCommandsFor({"config"}))
{ }
std::string description() override
{
return "manipulate the Nix configuration";
}
Category category() override { return catUtility; }
void run() override
{
if (!command)
throw UsageError("'nix config' requires a sub-command.");
command->second->run();
}
};
struct CmdConfigShow : Command, MixJSON
{
std::optional<std::string> name;
CmdShowConfig() {
CmdConfigShow() {
expectArgs({
.label = {"name"},
.optional = true,
@ -56,4 +76,5 @@ struct CmdShowConfig : Command, MixJSON
}
};
static auto rShowConfig = registerCommand<CmdShowConfig>("show-config");
static auto rCmdConfig = registerCommand<CmdConfig>("config");
static auto rShowConfig = registerCommand2<CmdConfigShow>({"config", "show"});

View file

@ -134,6 +134,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs, virtual RootArgs
{"ping-store", {"store", "ping"}},
{"sign-paths", {"store", "sign"}},
{"show-derivation", {"derivation", "show"}},
{"show-config", {"config", "show"}},
{"to-base16", {"hash", "to-base16"}},
{"to-base32", {"hash", "to-base32"}},
{"to-base64", {"hash", "to-base64"}},