how to extract TODOS from java source files
Hi I need a xxxreport like program to generate a todo 开发者_C百科list from java source files (in other words extract all //TODO comments) idealy to a latex list or are there any other good java 2 latex tools ? Thanks
Have you considered "grep -R" with post-massaging with awk or perl into the final form?
Eclipse generates a TODO list. Look at the Tasks view.
Ive made a simple python script which achieves this task thanks for the grep suggestion
#!/usr/bin/python import commands import sys path= sys.argv[1] a=commands.getoutput("grep -e //.*todo -e //.*TODO -R "+path).split("\n") print "\\begin{itemize}" lastFileName="" firstItem=1; open=0 for ln in a: ln=ln.replace("\t","").replace("//","").replace("{","").replace("}","").replace("\\","") if lastFileName!= ln[0:ln.find(":")]: lastFileName= ln[0:ln.find(":")] if firstItem!=1: print " \\end{itemize}" open=1 print "\\item "+lastFileName+" \n \\begin{itemize}" firstItem=0 open=1 print " \\item "+ln[ln.find(":"):len(ln)] if open: print " \\end{itemize}" print "\\end{itemize}"
精彩评论