From 3b4068fac968abbf9a6b60df1275771b51d90b71 Mon Sep 17 00:00:00 2001 From: Timo Schmidt Date: Tue, 28 Mar 2023 14:22:38 +0200 Subject: [PATCH] timo_moulinette --- .bashrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bashrc b/.bashrc index 75d013c..94f003a 100644 --- a/.bashrc +++ b/.bashrc @@ -12,9 +12,9 @@ alias watch='watch -cn.1' alias push='git push origin master; git push gitea master' alias norm='alacritty -e sh -c '\''git rev-parse --show-toplevel || { echo "Exiting in 5"; sleep 1; echo "Exiting in 4"; sleep 1; echo "Exiting in 3"; sleep 1; echo "Exiting in 2"; sleep 1; echo "Exiting in 1"; sleep 1; } && cd "$(git rev-parse --show-toplevel)" && watch -cn.5 date \&\& norminette -R CheckForbiddenSourceHeader'\'' & disown' jmp () { - cd "$(find . -name "${1}" -print -quit)" + cd "$(find . -name "${1}" -not -wholename "*mouli*" -print -quit)" if [ "${?}" = "0" ]; then - cd "$(find .. -name "${1}" -print -quit)" + cd "$(find .. -name "${1}" -not -wholename "*mouli*" -print -quit)" fi } @@ -124,7 +124,7 @@ timo_moulinette () { git_base="https://git.timo.one/42berlin/piscine-timo-moulinette/raw/branch/master" # Find the first C file - file_name="$(find . -mindepth 1 -maxdepth 1 -name '*.c' ! -name '*moulinette*' -type f -exec basename {} \; -quit)" + file_name="$(find . -mindepth 1 -maxdepth 1 -name '*.c' -not -name '*mouli*' -type f -exec basename {} \; -quit)" # If no C files found, exit if [ -z "${file_name}" ]; then @@ -148,7 +148,7 @@ timo_moulinette () { ${CC} -dD -E -o "${file_name}.nocomments" -- "${file_name}" # Extract function definitions from preprocessed file and append semicolon - prototypes="$(cat -- "${file_name}.nocomments" | grep -v '#' | grep ')$' | grep '[a-zA-Z0-9](' | grep -v 'int[[:space:]]\+main(' | sed 's/$/;/')" + prototypes="$(cat -- "${file_name}.nocomments" | grep -v '#' | grep ')$' | grep -v ' (' | grep -v ' ' | grep '[a-zA-Z0-9](' | grep -v 'int[[:space:]]\+main(' | sed 's/$/;/')" # Extract macros from file (ignore the ones with line continuations) macros="$(cat -- "${file_name}" | grep '^#' | grep -v '\\$')"