From 1bbe0e985a0b959a2d2429195d93166d93ceb521 Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Thu, 9 Jul 2020 07:42:09 +0200 Subject: [PATCH] update toploc to show only top 50 results --- dot_zsh_functions | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dot_zsh_functions b/dot_zsh_functions index b7addbb..68df639 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -164,12 +164,14 @@ cmd_loc="find . -type f \( \ -o -name '*.c' -o -name '*.h' \ -o -name '*.js' \ -o -name '*.tsx' \ + -o -name '*.sh' \ -o -name '*.md' \ -o -name '*.xml' \ + -o -name '*.yaml' -o -name '*.yml' \ -o -name '*.groovy' \ -o -name '*.gradle' \ -o -name '*.properties' \ - \) -exec \cat \{\} \; | LANG=C LC_CTYPE=C sed -e 's/^[ \t]*//;s/[ \t]*$//'" + \) -exec \cat \{\} \; | LANG=C LC_CTYPE=C sed -e 's/^[ \t]*//;s/[ \t]*$//'" # Unique lines of code # Via https://text.causal.agency/004-uloc.txt @@ -179,7 +181,7 @@ function uloc { # Top lines of code function toploc { - eval "$cmd_loc | LANG=C LC_CTYPE=C cut -c 1-100 | LANG=C LC_CTYPE=C sort | uniq -c | LANG=C LC_CTYPE=C sort -nr" + eval "$cmd_loc | LANG=C LC_CTYPE=C cut -c 1-100 | LANG=C LC_CTYPE=C sort | uniq -c | LANG=C LC_CTYPE=C sort -nr | head -50" } # Find files bigger than X size and sort them by size