How to hierarchically (levelize) arrange list of file names with matching pre-fixes (LCS) defining the hierarchy - preferably using shell tools
Source code dirs have meaningful file names. for example AAAbbbCCddEE.h/.cxx : where AAA, bb CC could refer to abbrev of sub-systems or just a functionality-description like "...Print..." or "...Check..."
as the code-base grows we land up with more than handful files per dir. it becomes daunting just to know what is doing what especially for newer-areas.
in this context a generic tool which would levelize all the file-names by dynamically maximally matching there names and display levels and files would be useful. what constitutes as a level depends whether a matching pre-fix exists in another file. so in above example if AAAbbbCCddFF.h/.cxx exists in same dir then both AAAbbbCCddFF and AAAbbbCCEE would belong to same lev开发者_如何转开发el (depth-4) AAAbbbCCdd and displayed together
looks doable with diff (on filenames itself) and shell tools - any similar-existing references would be useful?
Can you please clarify the directory and file naming conventions you have. Perhaps you can put a real example...
E.g.
CarAndEngineSubsystem/
CarThing1.h
CarThing1.cxx
NavigationSubsystem/
NAV_gizmo1.h
NAV_gizmo1.cxx
RapidNavigationSystem/
NAV_sys_gizmo2.h
NAV_sys_gizmo2.cxx
And just how close would it be to use
find . -type f | sort
精彩评论