From 5e0aad9befe6214134a77cb267b8c89596945109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 6 Jun 2011 10:53:10 +0200 Subject: add reformat --- reformat | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 reformat diff --git a/reformat b/reformat new file mode 100755 index 0000000..1b98e8c --- /dev/null +++ b/reformat @@ -0,0 +1,22 @@ +#! /bin/bash + +ASTYLEOPTS="-v \ + --indent=spaces=4 \ + --brackets=attach \ + --pad-paren-in \ + --indent-classes \ + --indent-preprocessor \ + --align-pointer=type \ + --suffix=none \ + --formatted + " +if [ $# -eq 0 ]; then + echo "need at least one argument" && exit 1 +fi + +CMD=$(which astyle) +if [ "X${CMD}" != "X" ]; then + echo $CMD $ASTYLEOPTS $@ + $CMD $ASTYLEOPTS $@ +fi + -- cgit v1.1-2-g2b99