mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 21:46:01 +01:00
nix-find-roots: Don't assume that argv[0] exists
This commit is contained in:
parent
65387ad3ea
commit
c4ca0d45cb
1 changed files with 2 additions and 1 deletions
|
|
@ -23,7 +23,8 @@ TracerConfig parseCmdLine(int argc, char** argv)
|
|||
fs::path socketPath = "/nix/var/nix/gc-trace-socket/socket";
|
||||
|
||||
auto usage = [&]() {
|
||||
std::cerr << "Usage: " << string(argv[0]) << " [--verbose|-v] [-s storeDir] [-d stateDir] [-l socketPath]" << std::endl;
|
||||
std::string programName = argc > 0 ? argv[0] : "nix-find-roots";
|
||||
std::cerr << "Usage: " << programName << " [--verbose|-v] [-s storeDir] [-d stateDir] [-l socketPath]" << std::endl;
|
||||
exit(1);
|
||||
};
|
||||
static struct option long_options[] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue