Styles
Pick one of five built-in styles with --style, or replace single glyphs with your own.
#Built-in styles
Every example shows fsg src/fsg -i "*hook.py" -i "*project_tree.py" --style NAME.
unicode (default)
fsg/
├── hooks/
│ ├── git_hook.py
│ ├── hook.py
│ └── pre_commit_hook.py
└── trees/
├── git_project_tree.py
├── plain_project_tree.py
└── project_tree.py rounded
fsg/
├── hooks/
│ ├── git_hook.py
│ ├── hook.py
│ ╰── pre_commit_hook.py
╰── trees/
├── git_project_tree.py
├── plain_project_tree.py
╰── project_tree.py heavy
fsg/
┣━━ hooks/
┃ ┣━━ git_hook.py
┃ ┣━━ hook.py
┃ ┗━━ pre_commit_hook.py
┗━━ trees/
┣━━ git_project_tree.py
┣━━ plain_project_tree.py
┗━━ project_tree.py double
fsg/
╠══ hooks/
║ ╠══ git_hook.py
║ ╠══ hook.py
║ ╚══ pre_commit_hook.py
╚══ trees/
╠══ git_project_tree.py
╠══ plain_project_tree.py
╚══ project_tree.py ascii
fsg/
|-- hooks/
| |-- git_hook.py
| |-- hook.py
| `-- pre_commit_hook.py
`-- trees/
|-- git_project_tree.py
|-- plain_project_tree.py
`-- project_tree.py #Your own glyphs
A style has four glyphs. --glyph KEY=VALUE replaces one of them, on top of the chosen style:
| Key | Used for | unicode |
|---|---|---|
branch |
Every entry except the last one of a directory | ├── |
last |
The last entry of a directory | └── |
pipe |
The line below an entry that has more siblings | │ |
space |
The indent below a last entry | four spaces |
$ fsg src/fsg -i "*hook.py" -i "*project_tree.py" --no-fence --glyph branch="+-- " --glyph last="\\-- " --glyph pipe=": "
fsg/
+-- hooks/
: +-- git_hook.py
: +-- hook.py
: \-- pre_commit_hook.py
\-- trees/
+-- git_project_tree.py
+-- plain_project_tree.py
\-- project_tree.py[tool.fsg.glyphs]
branch = "+-- "
last = "\\-- "
pipe = ": "Same width for allAll four glyphs must have the same width, otherwise fsg stops with an error.
$ fsg --glyph branch="+- "
✖ glyphs must all have the same width (branch=3, last=4, pipe=4, space=4)
hint: pad the shorter glyphs with spaces, e.g. --glyph pipe="| " #Summary line
--summary adds the number of directories and files below the tree:
$ fsg src/fsg -i "*hook.py" -i "*project_tree.py" --summary --no-fence
fsg/
├── hooks/
│ ├── git_hook.py
│ ├── hook.py
│ └── pre_commit_hook.py
└── trees/
├── git_project_tree.py
├── plain_project_tree.py
└── project_tree.py
2 directories, 6 files #ASCII only
For terminals and fonts without box-drawing characters, --ascii draws the ascii style and also replaces the status symbols:
| Status | Default | With --ascii |
|---|---|---|
| Success | ✔ |
[ok] |
| Info | • |
[info] |
| Error | ✖ |
[error] |