lix/src/nix/ping-store.cc
Eelco Dolstra 85c8be6286 Remove static variable name clashes
This was useful for an experiment with building Nix as a single
compilation unit. It's not very useful otherwise but also doesn't
hurt...
2020-10-06 13:49:20 +02:00

33 lines
689 B
C++

#include "command.hh"
#include "shared.hh"
#include "store-api.hh"
using namespace nix;
struct CmdPingStore : StoreCommand
{
std::string description() override
{
return "test whether a store can be opened";
}
Examples examples() override
{
return {
Example{
"To test whether connecting to a remote Nix store via SSH works:",
"nix ping-store --store ssh://mac1"
},
};
}
Category category() override { return catUtility; }
void run(ref<Store> store) override
{
store->connect();
}
};
static auto rCmdPingStore = registerCommand<CmdPingStore>("ping-store");