X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=scripts%2Fsource-code-stats;fp=scripts%2Fsource-code-stats;h=6f8ea866c909011838d74969c706ae1fa33e5499;hb=44cf3a183f532d96ad1fa825f6a57f1d06578a9b;hp=0000000000000000000000000000000000000000;hpb=9ec013ddc993b8113432c977767e2adc25e0dcfd;p=hvutilities.git diff --git a/scripts/source-code-stats b/scripts/source-code-stats new file mode 100755 index 0000000..6f8ea86 --- /dev/null +++ b/scripts/source-code-stats @@ -0,0 +1,36 @@ +#!/bin/bash + +# Comptage des lignes de code. + +# find $1 -print0 | xargs -0 touch +# That terminates each filename with \000 (character 0) and instructs xargs to expect the filenames terminated by \000 +# +# -print0 +# True; print the full file name on the standard output, followed +# by a null character (instead of the newline character that +# -print uses). This allows file names that contain newlines or +# other types of white space to be correctly interpreted by pro‐ +# grams that process the find output. This option corresponds to +# the -0 option of xargs. + +echo -n "Lignes de code: " +find . \ + \( \ + -name '*.c' -o \ + -name '*.C' -o \ + -name '*.h' -o \ + -name '*.H' -o \ + -name '*.cxgate' \ + \) \ + -print0 | xargs -0 cat | wc -l + +echo -n "Fichiers: " +find . \ + \( \ + -name '*.c' -o \ + -name '*.C' -o \ + -name '*.h' -o \ + -name '*.H' -o \ + -name '*.cxgate' \ + \) \ + -print | wc -l