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 '\\$')"