mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 00:06:16 +02:00
--version: Print some config info
Such as whether Nix is built with signed binary cache support, and the location of the configuration file.
This commit is contained in:
parent
1993b10d11
commit
887bb5fa5a
3 changed files with 28 additions and 2 deletions
|
@ -243,6 +243,20 @@ void parseCmdLine(int argc, char * * argv,
|
||||||
void printVersion(const string & programName)
|
void printVersion(const string & programName)
|
||||||
{
|
{
|
||||||
std::cout << format("%1% (Nix) %2%") % programName % nixVersion << std::endl;
|
std::cout << format("%1% (Nix) %2%") % programName % nixVersion << std::endl;
|
||||||
|
if (verbosity > lvlInfo) {
|
||||||
|
Strings cfg;
|
||||||
|
#if HAVE_BOEHMGC
|
||||||
|
cfg.push_back("gc");
|
||||||
|
#endif
|
||||||
|
#if HAVE_SODIUM
|
||||||
|
cfg.push_back("signed-caches");
|
||||||
|
#endif
|
||||||
|
std::cout << "Features: " << concatStringsSep(", ", cfg) << "\n";
|
||||||
|
std::cout << "Configuration file: " << settings.nixConfDir + "/nix.conf" << "\n";
|
||||||
|
std::cout << "Store directory: " << settings.nixStore << "\n";
|
||||||
|
std::cout << "State directory: " << settings.nixStateDir << "\n";
|
||||||
|
std::cout << "Database directory: " << settings.nixDBPath << "\n";
|
||||||
|
}
|
||||||
throw Exit();
|
throw Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1282,6 +1282,12 @@ static void opDeleteGenerations(Globals & globals, Strings opFlags, Strings opAr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void opVersion(Globals & globals, Strings opFlags, Strings opArgs)
|
||||||
|
{
|
||||||
|
printVersion("nix-env");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char * * argv)
|
int main(int argc, char * * argv)
|
||||||
{
|
{
|
||||||
return handleExceptions(argv[0], [&]() {
|
return handleExceptions(argv[0], [&]() {
|
||||||
|
@ -1311,7 +1317,7 @@ int main(int argc, char * * argv)
|
||||||
if (*arg == "--help")
|
if (*arg == "--help")
|
||||||
showManPage("nix-env");
|
showManPage("nix-env");
|
||||||
else if (*arg == "--version")
|
else if (*arg == "--version")
|
||||||
printVersion("nix-env");
|
op = opVersion;
|
||||||
else if (*arg == "--install" || *arg == "-i")
|
else if (*arg == "--install" || *arg == "-i")
|
||||||
op = opInstall;
|
op = opInstall;
|
||||||
else if (parseAutoArgs(arg, end, autoArgs_))
|
else if (parseAutoArgs(arg, end, autoArgs_))
|
||||||
|
|
|
@ -1027,6 +1027,12 @@ static void opGenerateBinaryCacheKey(Strings opFlags, Strings opArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void opVersion(Strings opFlags, Strings opArgs)
|
||||||
|
{
|
||||||
|
printVersion("nix-store");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Scan the arguments; find the operation, set global flags, put all
|
/* Scan the arguments; find the operation, set global flags, put all
|
||||||
other flags in a list, and put all other arguments in another
|
other flags in a list, and put all other arguments in another
|
||||||
list. */
|
list. */
|
||||||
|
@ -1044,7 +1050,7 @@ int main(int argc, char * * argv)
|
||||||
if (*arg == "--help")
|
if (*arg == "--help")
|
||||||
showManPage("nix-store");
|
showManPage("nix-store");
|
||||||
else if (*arg == "--version")
|
else if (*arg == "--version")
|
||||||
printVersion("nix-store");
|
op = opVersion;
|
||||||
else if (*arg == "--realise" || *arg == "--realize" || *arg == "-r")
|
else if (*arg == "--realise" || *arg == "--realize" || *arg == "-r")
|
||||||
op = opRealise;
|
op = opRealise;
|
||||||
else if (*arg == "--add" || *arg == "-A")
|
else if (*arg == "--add" || *arg == "-A")
|
||||||
|
|
Loading…
Reference in a new issue