Skip to content

Commit e2ecb4b

Browse files
rename null option to print0
1 parent 343fa15 commit e2ecb4b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

clang/tools/clang-format/git-clang-format

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ def main():
206206
),
207207
)
208208
p.add_argument(
209-
"-0",
210-
"--null",
209+
"--print0",
211210
action="store_true",
212211
help="end each printed filename with a null character",
213212
)
@@ -267,14 +266,14 @@ def main():
267266
"ignored by clang-format):"
268267
)
269268
for filename in ignored_files:
270-
print_filename(filename, opts.null)
269+
print_filename(filename, opts.print0)
271270
if changed_lines:
272271
print("Running clang-format on the following files:")
273272
for filename in changed_lines:
274-
print_filename(filename, opts.null)
273+
print_filename(filename, opts.print0)
275274

276275
if not changed_lines:
277-
if opts.verbose >= 0 and not opts.null:
276+
if opts.verbose >= 0 and not opts.print0:
278277
print("no modified files to format")
279278
return 0
280279

@@ -295,7 +294,7 @@ def main():
295294
print("new tree: %s" % new_tree)
296295

297296
if old_tree == new_tree:
298-
if opts.verbose >= 0 and not opts.null:
297+
if opts.verbose >= 0 and not opts.print0:
299298
print("clang-format did not modify any files")
300299
return 0
301300

@@ -308,10 +307,10 @@ def main():
308307
old_tree, new_tree, force=opts.force, patch_mode=opts.patch
309308
)
310309
if (opts.verbose >= 0 and not opts.patch) or opts.verbose >= 1:
311-
if not opts.null:
310+
if not opts.print0:
312311
print("changed files:")
313312
for filename in changed_files:
314-
print_filename(filename, opts.null)
313+
print_filename(filename, opts.print0)
315314

316315
return 1
317316

0 commit comments

Comments
 (0)