From c83e7d489bad64eecc5e91ea55526c4a9da0a85e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 11 Apr 2008 15:36:42 +0200 Subject: [PATCH] update the indent_script --- indent_script | 61 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/indent_script b/indent_script index c67d667..5e1a8b0 100755 --- a/indent_script +++ b/indent_script @@ -1,14 +1,67 @@ #!/bin/sh -# Nico Schottelius (nico-linux@schottelius.org) +# Nico Schottelius (nico-linux at schottelius.org) # indents like kr with a little bit more beauty look # 13-May-2004 -# written for the monotone project +# written for the monotone project, adapted for all my projects +# +# Copying: GPLv3 if [ $# -lt 1 ]; then echo "$0: " exit 1 fi -for file in $@; do - indent -nbad -bap -ts3 -nut -sc -br -ce -cdw -cli0 -nbc -brs -i3 -lp -ppi3 -di1 -c33 -cd33 -ncdb -ci3 -cp33 -cs -d0 -di0 -l75 -bbo -nfc1 -nfca -hnl -ip0 -npcs -nprs -saf -sai -saw -nsob -nss -npsl "$file" +opts="" +opts="${opts} -bap" # --blank-lines-after-procedures +opts="${opts} -bbb" # --blank-lines-before-block-comments +opts="${opts} -bad" # --blank-lines-after-declarations +opts="${opts} -bbo" # --break-before-boolean-operator +opts="${opts} -br" # --braces-on-if-line +opts="${opts} -brs" # --braces-on-struct-decl-line +opts="${opts} -cdb" # --comment-delimiters-on-blank-lines +opts="${opts} -cbi0" # --case-brace-indentation +opts="${opts} -cdw" # --cuddle-do-while +opts="${opts} -ce" # --cuddle-else, see -br +opts="${opts} -ci0" # --continuation-indentation (see -lp) +opts="${opts} -cli3" # --case-indentation +opts="${opts} -cp33" # --else-endif-columnn +opts="${opts} -cs" # --space-after-cast +opts="${opts} -d0" # --line-comments-indentationn +opts="${opts} -di0" # --declaration-indentation +opts="${opts} -fca" # --format-all-comments +opts="${opts} -hnl" # --honour-newlines +opts="${opts} -i3" # --indent-level +opts="${opts} -ip0" # --parameter-indentation +opts="${opts} -l80" # --line-length +opts="${opts} -lc80" # --line-length +opts="${opts} -lp" # --continue-at-parentheses +opts="${opts} -lps" # --leave-preprocessor-space +opts="${opts} -nbc" # --no-blank-lines-after-commas +opts="${opts} -nbfda" # --dont-break-function-decl-args +opts="${opts} -nbfde" # NOT --break-function-decl-args +opts="${opts} -nfc1" # --dont-format-first-column-comments +opts="${opts} -npcs" # --no-space-after-function-call-names +opts="${opts} -nprs" # --no-space-after-parentheses +opts="${opts} -npsl" # --dont-break-procedure-type +opts="${opts} -nsaf" # --no-space-after-for +opts="${opts} -nsai" # --no-space-after-if +opts="${opts} -nsaw" # --no-space-after-while +opts="${opts} -npsl" # --dont-break-procedure-type +opts="${opts} -nut" # --no-tabs +opts="${opts} -nv" # --no-verbosity +opts="${opts} -npro" # --ignore-profile +opts="${opts} -pi0" # --paren-indentationn +opts="${opts} -ppi3" # preprocessor indent +opts="${opts} -sbi0" # --struct-brace-indentation +opts="${opts} -sc" # --start-left-side-of-comments +opts="${opts} -sob" # --swallow-optional-blank-lines +opts="${opts} -ss" # --space-special-semicolon + + + +for file in "$@"; do + indent $opts "$file" done + # old: +# -ad \ +# -ts3 -nut -sc -ce -cdw -cli0 -nbc lp -ppi3 -di1 -c33 -cd33 -ncdb -ci3 -cp33 -cs -d0 -di0 -l75 -nfc1 -nfca -hnl -ip0 -nprs -saf -sai -saw -nsob -nss -npsl "$file"