Stile

Wähl mit --style einen von fünf eingebauten Stilen oder ersetze einzelne Zeichen durch eigene.

#Eingebaute Stile

Jedes Beispiel zeigt fsg src/fsg -i "*hook.py" -i "*project_tree.py" --style NAME.

unicode (Standard)
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

#Eigene Zeichen

Ein Stil hat vier Zeichen. --glyph KEY=VALUE ersetzt eines davon, aufbauend auf dem gewählten Stil:

Schlüssel Wofür unicode
branch Jeder Eintrag außer dem letzten eines Verzeichnisses ├──
last Der letzte Eintrag eines Verzeichnisses └──
pipe Die Linie unter einem Eintrag, der weitere Geschwister hat │
space Die Einrückung unter einem letzten Eintrag vier Leerzeichen
$ 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 = ":   "
Gleiche Breite für alleAlle vier Zeichen müssen gleich breit sein, sonst bricht fsg mit einem Fehler ab.
$ 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="|   "

#Zusammenfassung

--summary hängt die Anzahl der Verzeichnisse und Dateien unter dem Baum an:

$ 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

#Nur ASCII

Für Terminals und Schriftarten ohne Rahmenzeichen zeichnet --ascii den Stil ascii und ersetzt auch die Statussymbole:

Status Standard Mit --ascii
Erfolg ✔ [ok]
Info • [info]
Fehler ✖ [error]
Zuletzt aktualisiert: Seite bearbeiten