Skip to content

Commit c476948

Browse files
committed
[include-cleaner] rename enabled flags to disable-*
1 parent fe6bced commit c476948

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

clang-tools-extra/include-cleaner/test/tool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ int x = foo();
66
// CHANGE: - "foobar.h"
77
// CHANGE-NEXT: + "foo.h"
88

9-
// RUN: clang-include-cleaner -remove=0 -print=changes %s -- -I%S/Inputs/ | FileCheck --check-prefix=INSERT %s
9+
// RUN: clang-include-cleaner -disable-remove -print=changes %s -- -I%S/Inputs/ | FileCheck --check-prefix=INSERT %s
1010
// INSERT-NOT: - "foobar.h"
1111
// INSERT: + "foo.h"
1212

13-
// RUN: clang-include-cleaner -insert=0 -print=changes %s -- -I%S/Inputs/ | FileCheck --check-prefix=REMOVE %s
13+
// RUN: clang-include-cleaner -disable-insert -print=changes %s -- -I%S/Inputs/ | FileCheck --check-prefix=REMOVE %s
1414
// REMOVE: - "foobar.h"
1515
// REMOVE-NOT: + "foo.h"
1616

clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ cl::opt<bool> Edit{
9191
cl::cat(IncludeCleaner),
9292
};
9393

94-
cl::opt<bool> Insert{
95-
"insert",
96-
cl::desc("Allow header insertions"),
97-
cl::init(true),
94+
cl::opt<bool> DisableInsert{
95+
"disable-insert",
96+
cl::desc("DIsable header insertions"),
97+
cl::init(false),
9898
cl::cat(IncludeCleaner),
9999
};
100-
cl::opt<bool> Remove{
101-
"remove",
102-
cl::desc("Allow header removals"),
103-
cl::init(true),
100+
cl::opt<bool> DisableRemove{
101+
"disable-remove",
102+
cl::desc("Disable header removals"),
103+
cl::init(false),
104104
cl::cat(IncludeCleaner),
105105
};
106106

@@ -183,9 +183,9 @@ class Action : public clang::ASTFrontendAction {
183183
auto Results =
184184
analyze(AST.Roots, PP.MacroReferences, PP.Includes, &PI,
185185
getCompilerInstance().getPreprocessor(), HeaderFilter);
186-
if (!Insert)
186+
if (DisableInsert)
187187
Results.Missing.clear();
188-
if (!Remove)
188+
if (DisableRemove)
189189
Results.Unused.clear();
190190
std::string Final = fixIncludes(Results, AbsPath, Code, getStyle(AbsPath));
191191

0 commit comments

Comments
 (0)