lix/src/nix/optimise-store.cc
Eelco Dolstra ac67685606 Make subcommand construction in MultiCommand lazy
(cherry picked from commit a0de58f471)
2019-12-05 20:19:26 +01:00

33 lines
622 B
C++

#include "command.hh"
#include "shared.hh"
#include "store-api.hh"
#include <atomic>
using namespace nix;
struct CmdOptimiseStore : StoreCommand
{
std::string description() override
{
return "replace identical files in the store by hard links";
}
Examples examples() override
{
return {
Example{
"To optimise the Nix store:",
"nix optimise-store"
},
};
}
void run(ref<Store> store) override
{
store->optimiseStore();
}
};
static auto r1 = registerCommand<CmdOptimiseStore>("optimise-store");