git @ Cat's Eye Technologies tree / baebd3b
Merge branch 'master' of https://github.com/cpressey/tree Chris Pressey 10 years ago
2 changed file(s) with 8 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
00 `tree`
11 ======
22
3 This is Cat's Eye Technologies' `tree`, a simple command-line tool that
4 displays an indented directory tree. It:
3 This is `tree`, a command-line tool that displays an indented directory tree,
4 similar to "The Tree Command for Linux" except simpler. It:
55
66 * is written in Python (tested with 2.7.6)
77 * is small and has no dependencies besides Python
1111 me, that's the point of this sort of tool: give me a conceptual overview of
1212 the directory structure at this point in the filesystem, so I can orient
1313 myself)
14 * never follows symbolic links
1415 * supports one option, `--full`, which lists all files in each directory
1516 instead of giving you the summary
1617 * always outputs a `/` after each directory name
2627
2728 tree [-f|--full] [DIRECTORY]
2829
30 If DIRECTORY is not supplied, the current directory is assumed.
31
2932 Related work
3033 ------------
3134
1616 if filename.startswith('.'):
1717 continue
1818 fullname = os.path.join(dirname, filename)
19 if os.path.isdir(fullname):
19 if os.path.islink(fullname):
20 subfilenames.append(filename)
21 elif os.path.isdir(fullname):
2022 dirnames.append(filename)
2123 else:
2224 subfilenames.append(filename)