From 9ec52aa49f04f601e899282d7dc653c88e120b5c Mon Sep 17 00:00:00 2001 From: fatalerrors Date: Tue, 19 May 2026 17:39:15 +0200 Subject: [PATCH] update doc --- README.md | 19 +++++++++++++++++-- doc/CHANGELOG.md | 5 +++++ doc/FAQ.md | 27 +++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9067978..d0ed9be 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,22 @@ source /opt/profile/profile.sh It's not recommended to load that profile in `/etc/profile` as users' `.bashrc` files might interfere with some aliases and functions defined in profile. -### 2.1. Initial configuration +### 2.1. Interactive vs non-interactive shells + +`profile.sh` detects whether the current shell is interactive. + +In interactive shells (typical terminal sessions), profile enables +interactive-only features such as: +- aliases from `[aliases]` +- bash completion scripts from `profile.d/bash-completion/` +- prompt initialization (`PROMPT_COMMAND` and timer hook) +- welcome display (`showinfo`) and startup update check (`check_updates -q`) + +In non-interactive shells (typical script execution), those features are +intentionally skipped to avoid side effects and startup noise. Public functions +remain available after sourcing, so scripts can still call profile helpers. + +### 2.2. Initial configuration Copy the example configuration file and customise it to your needs: ```bash cp /profile/doc/profile.conf.example /profile/profile.conf @@ -132,7 +147,7 @@ apply when unset. `profile.conf` is listed in `.gitignore` so personal values (API keys, cities, compiler flags, …) are never accidentally staged. Start from the annotated -template at `doc/profile.conf.example` (see [section 2.1](#21-initial-configuration)). +template at `doc/profile.conf.example` (see [section 2.2](#22-initial-configuration)). ### 4.1. Core sections diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 451c9e1..8336fed 100755 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -23,6 +23,11 @@ Versions follow `MAJOR.MINOR.PATCH-REVISION_STAGE_N` (e.g. `3.99.1-4_rc_1`). - `disp` now wraps long messages on terminal width, avoids mid-word splits, and aligns continuation lines with the message body after the prefix. - `help` now supports `help ` and delegates to ` --help`. +- `taz` now supports `-p auto` / `--parallel=auto` to automatically use the + runtime CPU count. This mode is now the default via + `TAZ_DEFAULT_THREADS=auto`. +- `taz` keeps backward compatibility with legacy `TAZ_DEFAULT_THREADS=0` + values by interpreting `0` as `auto`. ### Fixed - Startup responsiveness improved: `check_updates -q` now uses a short network diff --git a/doc/FAQ.md b/doc/FAQ.md index c556c34..96d6153 100755 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -52,6 +52,33 @@ scripts start with `#!/usr/bin/env bash`. --- +**Q: Can I use profile functions in scripts?** + +Yes. The supported way is to source `profile.sh` from a Bash script: +```bash +#!/usr/bin/env bash +source /path/to/profile/profile.sh + +taz -p auto -f lz mydir +``` +You can also source one module directly (for example +`profile.d/compress.sh`) if you only need a subset of functions. + +When you source a module directly, profile configuration parsing/loading from +`profile.sh` is skipped, so defaults from `profile.conf` are not applied unless +your script loads them explicitly. + +`profile.sh` also detects whether the current shell is interactive. In +non-interactive shells (typical script execution), interactive-only features +are intentionally disabled: prompt setup, aliases, welcome/info messages, and +startup update checks are not enabled. + +In all cases, avoid aliases in scripts. Use real commands/functions instead, +because alias expansion is interactive-shell oriented and can be disabled or +behave differently in non-interactive execution. + +--- + **Q: I set `PROFILE_PATH` but profile still can't find its modules.** `PROFILE_PATH` must be exported *before* you source `profile.sh`: