mirror of
https://github.com/NixOS/nix.git
synced 2025-12-23 09:21:09 +01:00
Move /src to /subprojects
This will facilitate breaking up Nix into multiple packages for each component with Meson.
This commit is contained in:
parent
4db9487823
commit
84e2963f8e
737 changed files with 504 additions and 505 deletions
70
subprojects/libmain/common-args.hh
Normal file
70
subprojects/libmain/common-args.hh
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#pragma once
|
||||
///@file
|
||||
|
||||
#include "args.hh"
|
||||
#include "repair-flag.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
//static constexpr auto commonArgsCategory = "Miscellaneous common options";
|
||||
static constexpr auto loggingCategory = "Logging-related options";
|
||||
static constexpr auto miscCategory = "Miscellaneous global options";
|
||||
|
||||
class MixCommonArgs : public virtual Args
|
||||
{
|
||||
void initialFlagsProcessed() override;
|
||||
public:
|
||||
std::string programName;
|
||||
MixCommonArgs(const std::string & programName);
|
||||
protected:
|
||||
virtual void pluginsInited() {}
|
||||
};
|
||||
|
||||
struct MixDryRun : virtual Args
|
||||
{
|
||||
bool dryRun = false;
|
||||
|
||||
MixDryRun()
|
||||
{
|
||||
addFlag({
|
||||
.longName = "dry-run",
|
||||
.description = "Show what this command would do without doing it.",
|
||||
//.category = commonArgsCategory,
|
||||
.handler = {&dryRun, true},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
struct MixJSON : virtual Args
|
||||
{
|
||||
bool json = false;
|
||||
|
||||
MixJSON()
|
||||
{
|
||||
addFlag({
|
||||
.longName = "json",
|
||||
.description = "Produce output in JSON format, suitable for consumption by another program.",
|
||||
//.category = commonArgsCategory,
|
||||
.handler = {&json, true},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
struct MixRepair : virtual Args
|
||||
{
|
||||
RepairFlag repair = NoRepair;
|
||||
|
||||
MixRepair()
|
||||
{
|
||||
addFlag({
|
||||
.longName = "repair",
|
||||
.description =
|
||||
"During evaluation, rewrite missing or corrupted files in the Nix store. "
|
||||
"During building, rebuild missing or corrupted store paths.",
|
||||
.category = miscCategory,
|
||||
.handler = {&repair, Repair},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue