On Mon, 14 Nov 2011 00:30:59 -0800
"Enlightenment SVN" <no-re...@enlightenment.org> wrote:

> Log:
> discomfitor - how is this now for a formatting script?
>   
>   
> 
> Author:       raster
> Date:         2011-11-14 00:30:59 -0800 (Mon, 14 Nov 2011)
> New Revision: 65155
> Trac:         http://trac.enlightenment.org/e/changeset/65155
> 
> Modified:
>   trunk/FORMATTING/formatefl.sh 
> 
> Modified: trunk/FORMATTING/formatefl.sh
> ===================================================================
> --- trunk/FORMATTING/formatefl.sh     2011-11-14 08:30:39 UTC (rev 65154)
> +++ trunk/FORMATTING/formatefl.sh     2011-11-14 08:30:59 UTC (rev 65155)
> @@ -47,27 +47,56 @@
>    while [ -n "$X" ]; do
>      shift
>      echo "Fixing function newlines in $X..."
> -    sed -r 's/^([a-zA-Z].*\*?) ([a-z][a-zA-Z0-9_]*\()/\1\n\2/' < $X > $T
> -    cp $T $X
> -    rm $T
> +#    sed -r 's/^([a-zA-Z].*\*?) ([a-z][a-zA-Z0-9_]*\()/\1\n\2/' < $X > $T
> +#    cp $T $X
> +#    sed -r 's/{$/\n{/' < $X > $T
> +#    cp $T $X
> +#    rm $T
>      X="$1"
>    done
>  }
> -FMT1="funcnewlines"
> -FMT2="$UNC -c $HOME/.ecrustify.cfg --no-backup --replace -l C"
> -FMT3="$UNC -c $HOME/.ecrustify.cfg --no-backup --replace -l CPP"
> -FMTH="$UNC -c $HOME/.ecrustify-headers.cfg --no-backup --replace -l C"
>  
> -F=$(find $1 -name '*.c' -print)
> -if [[ -n "$F" ]]; then $FMT1 $F; $FMT2 $F; fi
> -F=$(find $1 -name '*.cpp' -print)
> -if [[ -n "$F" ]]; then $FMT1 $F; $FMT3 $F; fi
> +INDENTOPS="-gnu -l9999 -lc9999 -ncs -npcs -nprs"
>  
> -F=$(find $1 -name '*.[hx]' -print)
> -if [[ -n "$F" ]]; then $FMT1 $F; $FMTH $F; fi
> -F=$(find $1 -name '*.h.in' -print)
> -if [[ -n "$F" ]]; then $FMT1 $F; $FMTH $F; fi
> +function fmtc ()
> +{
> +  if [[ -z "$@" ]]; then return; fi
> +  indent $INDENTOPS $@
> +  funcnewlines $@
> +  $UNC -c $HOME/.ecrustify.cfg --no-backup --replace -l C $@
> +}
>  
> +function fmtcpp ()
> +{
> +  if [[ -z "$@" ]]; then return; fi
> +  indent $INDENTOPS $@
> +  funcnewlines $@
> +  $UNC -c $HOME/.ecrustify.cfg --no-backup --replace -l CPP $@
> +}
> +
> +function fmth ()
> +{
> +  if [[ -z "$@" ]]; then return; fi
> +  indent $INDENTOPS $@
> +  funcnewlines $@
> +  $UNC -c $HOME/.ecrustify-headers.cfg --no-backup --replace -l C $@
> +}
> +
> +function fmthpp ()
> +{
> +  if [[ -z "$@" ]]; then return; fi
> +  indent $INDENTOPS $@
> +  funcnewlines $@
> +  $UNC -c $HOME/.ecrustify-headers.cfg --no-backup --replace -l CPP $@
> +}
> +
> +fmtc `find $1 -name '*.c' -print`
> +fmtcpp `find $1 -name '*.cpp' -print`
> +fmth `find $1 -name '*.h' -print`
> +fmthpp `find $1 -name '*.hpp' -print`
> +fmth `find $1 -name '*.h.in' -print`
> +fmthpp `find $1 -name '*.hpp.in' -print`
> +
>    echo "==================================================================="
>    echo " DONE"
>    echo "==================================================================="
> 
> 
it looks like a script that does formatting to me

-- 
Mike Blumenkrantz
Zentific: Doctor recommended, mother approved.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to