Nix
2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
common-args.hh
Go to the documentation of this file.
1
#pragma once
3
4
#include "
lix/libutil/args.hh
"
5
#include "
lix/libutil/repair-flag.hh
"
6
7
namespace
nix {
8
9
//static constexpr auto commonArgsCategory = "Miscellaneous common options";
10
static
constexpr
auto
loggingCategory =
"Logging-related options"
;
11
static
constexpr
auto
miscCategory =
"Miscellaneous global options"
;
12
13
class
MixCommonArgs
:
public
virtual
Args
14
{
15
void
initialFlagsProcessed()
override
;
16
public
:
17
std::string programName;
18
MixCommonArgs
(
const
std::string & programName);
19
protected
:
20
virtual
void
pluginsInited() {}
21
};
22
23
struct
MixDryRun
:
virtual
Args
24
{
25
bool
dryRun =
false
;
26
27
MixDryRun
()
28
{
29
addFlag({
30
.longName =
"dry-run"
,
31
.description =
"Show what this command would do without doing it."
,
32
//.category = commonArgsCategory,
33
.handler = {&dryRun,
true
},
34
});
35
}
36
};
37
38
struct
MixJSON
:
virtual
Args
39
{
40
bool
json =
false
;
41
42
MixJSON
()
43
{
44
addFlag({
45
.longName =
"json"
,
46
.description =
"Produce output in JSON format, suitable for consumption by another program."
,
47
//.category = commonArgsCategory,
48
.handler = {&json,
true
},
49
});
50
}
51
};
52
53
struct
MixRepair
:
virtual
Args
54
{
55
RepairFlag repair = NoRepair;
56
57
MixRepair
()
58
{
59
addFlag({
60
.longName =
"repair"
,
61
.description =
62
"During evaluation, rewrite missing or corrupted files in the Nix store. "
63
"During building, rebuild missing or corrupted store paths."
,
64
.category = miscCategory,
65
.handler = {&repair, Repair},
66
});
67
}
68
};
69
70
}
args.hh
nix::Args
Definition
args.hh:31
nix::MixCommonArgs
Definition
common-args.hh:14
repair-flag.hh
nix::MixDryRun
Definition
common-args.hh:24
nix::MixJSON
Definition
common-args.hh:39
nix::MixRepair
Definition
common-args.hh:54
lix
libmain
common-args.hh
Generated by
1.10.0