Skip to content

Commit 06acbd3

Browse files
committed
Add trailing commas on addFlag incantations
1 parent 596389a commit 06acbd3

19 files changed

+64
-62
lines changed

src/libcmd/command.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,13 @@ void StorePathCommand::run(ref<Store> store, StorePaths && storePaths)
237237

238238
MixProfile::MixProfile()
239239
{
240-
addFlag(
241-
{.longName = "profile",
240+
addFlag({
241+
.longName = "profile",
242242
.description = "The profile to operate on.",
243243
.labels = {"path"},
244244
.handler = {&profile},
245-
.completer = completePath});
245+
.completer = completePath,
246+
});
246247
}
247248

248249
void MixProfile::updateProfile(const StorePath & storePath)

src/libcmd/common-eval-args.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ MixEvalArgs::MixEvalArgs()
6363
.description = "Pass the value *expr* as the argument *name* to Nix functions.",
6464
.category = category,
6565
.labels = {"name", "expr"},
66-
.handler = {[&](std::string name, std::string expr) { autoArgs.insert_or_assign(name, AutoArg{AutoArgExpr{expr}}); }}
66+
.handler = {[&](std::string name, std::string expr) { autoArgs.insert_or_assign(name, AutoArg{AutoArgExpr{expr}}); }},
6767
});
6868

6969
addFlag({
@@ -80,7 +80,7 @@ MixEvalArgs::MixEvalArgs()
8080
.category = category,
8181
.labels = {"name", "path"},
8282
.handler = {[&](std::string name, std::string path) { autoArgs.insert_or_assign(name, AutoArg{AutoArgFile{path}}); }},
83-
.completer = completePath
83+
.completer = completePath,
8484
});
8585

8686
addFlag({
@@ -105,7 +105,7 @@ MixEvalArgs::MixEvalArgs()
105105
.labels = {"path"},
106106
.handler = {[&](std::string s) {
107107
lookupPath.elements.emplace_back(LookupPath::Elem::parse(s));
108-
}}
108+
}},
109109
});
110110

111111
addFlag({
@@ -131,7 +131,7 @@ MixEvalArgs::MixEvalArgs()
131131
}},
132132
.completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
133133
completeFlakeRef(completions, openStore(), prefix);
134-
}}
134+
}},
135135
});
136136

137137
addFlag({

src/libcmd/installables.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,21 @@ MixFlakeOptions::MixFlakeOptions()
6464
.handler = {[&]() {
6565
lockFlags.recreateLockFile = true;
6666
warn("'--recreate-lock-file' is deprecated and will be removed in a future version; use 'nix flake update' instead.");
67-
}}
67+
}},
6868
});
6969

7070
addFlag({
7171
.longName = "no-update-lock-file",
7272
.description = "Do not allow any updates to the flake's lock file.",
7373
.category = category,
74-
.handler = {&lockFlags.updateLockFile, false}
74+
.handler = {&lockFlags.updateLockFile, false},
7575
});
7676

7777
addFlag({
7878
.longName = "no-write-lock-file",
7979
.description = "Do not write the flake's newly generated lock file.",
8080
.category = category,
81-
.handler = {&lockFlags.writeLockFile, false}
81+
.handler = {&lockFlags.writeLockFile, false},
8282
});
8383

8484
addFlag({
@@ -94,14 +94,14 @@ MixFlakeOptions::MixFlakeOptions()
9494
.handler = {[&]() {
9595
lockFlags.useRegistries = false;
9696
warn("'--no-registries' is deprecated; use '--no-use-registries'");
97-
}}
97+
}},
9898
});
9999

100100
addFlag({
101101
.longName = "commit-lock-file",
102102
.description = "Commit changes to the flake's lock file.",
103103
.category = category,
104-
.handler = {&lockFlags.commitLockFile, true}
104+
.handler = {&lockFlags.commitLockFile, true},
105105
});
106106

107107
addFlag({
@@ -121,7 +121,7 @@ MixFlakeOptions::MixFlakeOptions()
121121
}},
122122
.completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
123123
completeFlakeInputAttrPath(completions, getEvalState(), getFlakeRefsForCompletion(), prefix);
124-
}}
124+
}},
125125
});
126126

127127
addFlag({
@@ -141,7 +141,7 @@ MixFlakeOptions::MixFlakeOptions()
141141
} else if (n == 1) {
142142
completeFlakeRef(completions, getEvalState()->store, prefix);
143143
}
144-
}}
144+
}},
145145
});
146146

147147
addFlag({
@@ -152,7 +152,7 @@ MixFlakeOptions::MixFlakeOptions()
152152
.handler = {[&](std::string lockFilePath) {
153153
lockFlags.referenceLockFilePath = {getFSSourceAccessor(), CanonPath(absPath(lockFilePath))};
154154
}},
155-
.completer = completePath
155+
.completer = completePath,
156156
});
157157

158158
addFlag({
@@ -163,7 +163,7 @@ MixFlakeOptions::MixFlakeOptions()
163163
.handler = {[&](std::string lockFilePath) {
164164
lockFlags.outputLockFilePath = lockFilePath;
165165
}},
166-
.completer = completePath
166+
.completer = completePath,
167167
});
168168

169169
addFlag({
@@ -190,7 +190,7 @@ MixFlakeOptions::MixFlakeOptions()
190190
}},
191191
.completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
192192
completeFlakeRef(completions, getEvalState()->store, prefix);
193-
}}
193+
}},
194194
});
195195
}
196196

@@ -206,15 +206,15 @@ SourceExprCommand::SourceExprCommand()
206206
.category = installablesCategory,
207207
.labels = {"file"},
208208
.handler = {&file},
209-
.completer = completePath
209+
.completer = completePath,
210210
});
211211

212212
addFlag({
213213
.longName = "expr",
214214
.description = "Interpret [*installables*](@docroot@/command-ref/new-cli/nix.md#installables) as attribute paths relative to the Nix expression *expr*.",
215215
.category = installablesCategory,
216216
.labels = {"expr"},
217-
.handler = {&expr}
217+
.handler = {&expr},
218218
});
219219
}
220220

@@ -834,7 +834,7 @@ RawInstallablesCommand::RawInstallablesCommand()
834834
addFlag({
835835
.longName = "stdin",
836836
.description = "Read installables from the standard input. No default installable applied.",
837-
.handler = {&readFromStdIn, true}
837+
.handler = {&readFromStdIn, true},
838838
});
839839

840840
expectArgs({

src/libmain/common-args.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ MixCommonArgs::MixCommonArgs(const std::string & programName)
5959
if (hasPrefix(s.first, prefix))
6060
completions.add(s.first, fmt("Set the `%s` setting.", s.first));
6161
}
62-
}
62+
},
6363
});
6464

6565
addFlag({
@@ -77,7 +77,7 @@ MixCommonArgs::MixCommonArgs(const std::string & programName)
7777
.labels = Strings{"jobs"},
7878
.handler = {[=](std::string s) {
7979
settings.set("max-jobs", s);
80-
}}
80+
}},
8181
});
8282

8383
std::string cat = "Options to override configuration settings";

src/libmain/shared.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ LegacyArgs::LegacyArgs(const std::string & programName,
231231
.handler = {[=](std::string s) {
232232
auto n = string2IntWithUnitPrefix<uint64_t>(s);
233233
settings.set(dest, std::to_string(n));
234-
}}
234+
}},
235235
});
236236
};
237237

src/libstore/globals.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,21 +278,21 @@ template<> void BaseSetting<SandboxMode>::convertToArg(Args & args, const std::s
278278
.aliases = aliases,
279279
.description = "Enable sandboxing.",
280280
.category = category,
281-
.handler = {[this]() { override(smEnabled); }}
281+
.handler = {[this]() { override(smEnabled); }},
282282
});
283283
args.addFlag({
284284
.longName = "no-" + name,
285285
.aliases = aliases,
286286
.description = "Disable sandboxing.",
287287
.category = category,
288-
.handler = {[this]() { override(smDisabled); }}
288+
.handler = {[this]() { override(smDisabled); }},
289289
});
290290
args.addFlag({
291291
.longName = "relaxed-" + name,
292292
.aliases = aliases,
293293
.description = "Enable sandboxing, but allow builds to disable it.",
294294
.category = category,
295-
.handler = {[this]() { override(smRelaxed); }}
295+
.handler = {[this]() { override(smRelaxed); }},
296296
});
297297
}
298298

src/nix/build.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
5555
.description = "Use *path* as prefix for the symlinks to the build results. It defaults to `result`.",
5656
.labels = {"path"},
5757
.handler = {&outLink},
58-
.completer = completePath
58+
.completer = completePath,
5959
});
6060

6161
addFlag({

src/nix/bundle.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct CmdBundle : InstallableValueCommand
2424
.handler = {&bundler},
2525
.completer = {[&](AddCompletions & completions, size_t, std::string_view prefix) {
2626
completeFlakeRef(completions, getStore(), prefix);
27-
}}
27+
}},
2828
});
2929

3030
addFlag({
@@ -33,7 +33,7 @@ struct CmdBundle : InstallableValueCommand
3333
.description = "Override the name of the symlink to the build result. It defaults to the base name of the app.",
3434
.labels = {"path"},
3535
.handler = {&outLink},
36-
.completer = completePath
36+
.completer = completePath,
3737
});
3838

3939
}

src/nix/copy.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct CmdCopy : virtual CopyCommand, virtual BuiltPathsCommand, MixProfile
2121
.description = "Create symlinks prefixed with *path* to the top-level store paths fetched from the source store.",
2222
.labels = {"path"},
2323
.handler = {&outLink},
24-
.completer = completePath
24+
.completer = completePath,
2525
});
2626

2727
addFlag({

src/nix/derivation-show.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct CmdShowDerivation : InstallablesCommand, MixPrintJSON
2121
.longName = "recursive",
2222
.shortName = 'r',
2323
.description = "Include the dependencies of the specified derivations.",
24-
.handler = {&recursive, true}
24+
.handler = {&recursive, true},
2525
});
2626
}
2727

0 commit comments

Comments
 (0)