aboutsummaryrefslogtreecommitdiff
path: root/tools/clang-format/clang-format-diff.py
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:49:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:49:41 +0000
commit45b533945f0851ec234ca846e1af5ee1e4df0b6e (patch)
tree0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /tools/clang-format/clang-format-diff.py
parent7e86edd64bfae4e324224452e4ea879b3371a4bd (diff)
Vendor import of clang trunk r256633:vendor/clang/clang-trunk-r256633
Diffstat (limited to 'tools/clang-format/clang-format-diff.py')
-rwxr-xr-xtools/clang-format/clang-format-diff.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/clang-format/clang-format-diff.py b/tools/clang-format/clang-format-diff.py
index 64efb83a8c19..9e02bb09387f 100755
--- a/tools/clang-format/clang-format-diff.py
+++ b/tools/clang-format/clang-format-diff.py
@@ -52,6 +52,8 @@ def main():
r'|protodevel|java)',
help='custom pattern selecting file paths to reformat '
'(case insensitive, overridden by -regex)')
+ parser.add_argument('-sort-includes', action='store_true', default=False,
+ help='let clang-format sort include blocks')
parser.add_argument('-v', '--verbose', action='store_true',
help='be more verbose, ineffective without -i')
parser.add_argument(
@@ -96,6 +98,8 @@ def main():
command = [binary, filename]
if args.i:
command.append('-i')
+ if args.sort_includes:
+ command.append('-sort-includes')
command.extend(lines)
if args.style:
command.extend(['-style', args.style])