@@ -30,8 +30,7 @@ wiki/ # GitHub wiki documentation (git submodule)
3030
3131```
3232string.sh ← no dependencies (lowest level)
33- ↑
34- ansi-utils.sh ← loads string.sh (via ansi.sh or ansi-tput.sh)
33+ ansi-utils.sh ← no dependencies (shared helpers for ansi.sh / ansi-tput.sh)
3534 ↑
3635ansi.sh ← loads ansi-utils.sh (raw escape sequences)
3736ansi-tput.sh ← loads ansi-utils.sh (tput-based, alternative to ansi.sh)
@@ -50,9 +49,9 @@ args-completion.sh ← loads args.sh (registers args::on_options hook)
5049| Module | Auto-loads |
5150| ---| ---|
5251| ` string.sh ` | _ (nothing)_ |
53- | ` ansi-utils.sh ` | _ (nothing, but expects ` string.sh ` functions or degrades gracefully )_ |
54- | ` ansi.sh ` | ` ansi-utils.sh ` → ` string.sh ` |
55- | ` ansi-tput.sh ` | ` ansi-utils.sh ` → ` string.sh ` |
52+ | ` ansi-utils.sh ` | _ (nothing)_ |
53+ | ` ansi.sh ` | ` ansi-utils.sh ` |
54+ | ` ansi-tput.sh ` | ` ansi-utils.sh ` |
5655| ` box.sh ` | ` string.sh ` |
5756| ` args.sh ` | _ (nothing)_ |
5857| ` args-help.sh ` | ` ansi.sh ` , ` string.sh ` , ` box.sh ` |
@@ -79,11 +78,11 @@ This means modules can be sourced multiple times safely, and dependency loading
7978
8079### Terminal-aware output
8180
82- All output functions ( ` ansi::out ` , ` box::out ` , ` string::out ` ) detect whether stdout/stderr is a terminal:
81+ Output functions detect whether stdout/stderr is a terminal:
8382- ** Terminal** : output includes ANSI escape codes.
8483- ** Pipe/file** : escape codes are automatically stripped.
8584
86- The check is ` [[ -t 1 || -z "$TERM" ]] ` (fd 1 for stdout, fd 2 for stderr ).
85+ Stdout functions ( ` ::out ` ): check ` [[ -t 1 || -z "$TERM" ]] ` . Stderr functions ( ` ::err ` , ` ::warn ` ): check ` [[ -t 2 || -z "$TERM" ]] ` . ` ::err ` returns 1 (signals failure); ` ::warn ` returns 0 (safe under ` set -e ` ).
8786
8887### ANSI implementations
8988
0 commit comments