From e6c7f2e023a6febd360e6646e8d3224337a0a8bd Mon Sep 17 00:00:00 2001 From: John Jenkins Date: Mon, 16 Mar 2015 16:25:07 -0500 Subject: [PATCH] tweak to reformat tool --- doc/BUILD_STEPS | 9 +++++++++ reformat.sh | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/BUILD_STEPS b/doc/BUILD_STEPS index 4d5d1b9..0eeb05d 100644 --- a/doc/BUILD_STEPS +++ b/doc/BUILD_STEPS @@ -67,3 +67,12 @@ Notes on using the clang static analyzer - edit Makefile, and delete the "CC = mpicc" (or similar) line - run "scan-build --use-cc=mpicc make" +Notes on using uncrustify +----------------- +- version 0.61 is required +- build/install uncrustify from your favorite distro (0.61), OR download from + https://github.com/bengardner/uncrustify and build from source + (configure --prefix /path/to/install && make && make install) +- either use uncrustify directly (see uncrustify --help) or use the provided + reformat.sh tool which is a shim over some of the options (see reformat.sh + -h) diff --git a/reformat.sh b/reformat.sh index 758d71d..fde8467 100755 --- a/reformat.sh +++ b/reformat.sh @@ -18,6 +18,7 @@ USAGE: reformat.sh [-x] [-i] [-c CFG] [-b FILE] {-a | FILE...} -a: perform recursively on all files ending in .c or .h if -a not provided, then perform on all files passed in -x: instead of formatting, check if output format is the same as input + -h: show this help and exit EOF } @@ -40,7 +41,7 @@ do_recursive=no do_check=no blacklist= -while getopts ":ib:ax" opt; do +while getopts ":ib:axh" opt; do case $opt in i) do_inplace=yes @@ -57,6 +58,10 @@ while getopts ":ib:ax" opt; do x) do_check=yes ;; + h) + usage + exit 1 + ;; \?) usage error "invalid argument: -$OPTARG" -- 2.26.2