Refactor our command line ls-tree tool to use FileMode's type knowledge
Now that FileMode knows what type it should be we can use this
when we show the mode data as part of the ls-tree output.
We also disable recursive behavior by default, but turn it on
if the user requests recursive walking with "-r". This allows
us to run the TreeWalk code in both modes of operation, and is
also a way to better match the C Git version of this same tool.
I refactored how we decide if our argument is a directory or
not, as when we add index (aka dircache) walking to this we
will want to also guess if the name is a dircache path.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>