]>
git.ipfire.org Git - thirdparty/squid.git/blob - scripts/sort-includes.pl
6b9537d56d76502604d751f7198b92d845ef9568
3 ## Copyright (C) 1996-2015 The Squid Software Foundation and contributors
5 ## Squid software is distributed under GPLv2+ license and includes
6 ## contributions from numerous individuals and organizations.
7 ## Please see the COPYING and CONTRIBUTORS files for details.
10 # AUTHOR: Francesco Chemolli <kinkie@squid-cache.org>
12 # USAGE: sort-includes.pl filename.cc >filename.cc.sorted
14 # This tool helps to sort the #include directives in a c or c++ source file
15 # according to the Squid Coding guidelines.
17 # The output of the tool is a source file where each block of consecutive
18 # include directives for project-specific files (#include "header.h")
19 # is sorted with this specification: squid.h (if present) is alwasy first,
20 # then the other directives are sorted in case-insensitive alphabetical order.
23 # for file in $(find . -name \*.cc); do /full/path/to/sort-includes.pl $file >$file.sorted; mv $file.sorted $file; done
27 my @acc=(); #if empty, we're not accumulating
44 print sort {lc($a) cmp lc($b)} @acc;