This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NAME_H="libunit.h" | |
prot=$(find . -type d -name libft -prune -o -type f -name '*.c' | xargs cat | sed -e '/^[a-zA-Z].*)$/!d' -e '/^static/d' -e "s/)$/);/g") | |
TABS=$(echo "${prot}" | awk '{sub("[\t ].*", "");print length($0)}' | sort -nr | head -n 1 | xargs -I{} expr {} / 4 + 1) | |
header="$(sed -e "/^[a-zA-Z][a-zA-Z_0-9]*.*);$/d" -e '/#endif/d' -e '/^$/d' ${NAME_H}) | |
$(echo "${prot}" | awk -v tabs=${TABS} '{s=$0; sub("[\t ].*", ""); l=tabs - int(length($0) / 4); t="";for(i=0;i<l;i++){t=t "\t"};sub("[\t ][\t ]*", t, s); print s}') | |
#endif" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from datetime import datetime | |
def main(): | |
name = "unko" | |
mail = f"{name}@student.42tokyo.jp" | |
files = sys.argv[1:] | |
start = '/* ************************************************************************** */' | |
for file in files: |