-p view source code of the script with lines number, -v shows only the plain script

This commit is contained in:
2026-08-27 11:30:33 +01:00
parent a40e5dfba8
commit 84a7eb49fd
4 changed files with 61 additions and 25 deletions
+10 -7
View File
@@ -59,7 +59,7 @@ Instead of stuffing hundreds of aliases, functions, exports, and prompt customiz
| ❌ Hard to debug errors and test changes | ✅ Enable or disable modules instantly (`brc-script -e` / `-d`) |
| ❌ Risk of accidentally breaking the whole shell | ✅ Safe symlink-based activation and automatic backups |
| ❌ Impossible to share individual snippets | ✅ Modular files ready to share, version-control, or reuse |
| ❌ Manually editing files to preview snippets | ✅ Instant terminal preview with line numbering (`brc-script -p`) |
| ❌ Manually editing files to preview snippets | ✅ Instant terminal preview or cat (`brc-script -p` / `-v`) |
---
@@ -74,8 +74,8 @@ Instead of stuffing hundreds of aliases, functions, exports, and prompt customiz
-**Multi-Script Batch Management**
Enable, disable, preview, or remove multiple scripts at the same time using either their numeric ID or script name (e.g. `brc-script -e 1 3 4` or `brc-script -d 03_bashboard 04_aliases`).
- 👁️ **Instant Script Code Preview (`cat`)**
View script contents with colored status headers and line numbering without opening an external editor (`brc-script -p <id|name>`).
- 👁️ **Instant Script Code Preview & Cat (`-p` / `-v`)**
Inspect script contents directly in the terminal without opening an external editor. Use `brc-script -p <id|name>` for preview with colored headers and line numbers, or `brc-script -v <id|name>` (or `--cat`) for clean code cat without line numbers.
- 🖥️ **Smart System Bashboard**
Includes `03_bashboard.sh`, a fast MOTD-style dashboard showing CPU, RAM, disk usage, uptime, distro details, IP addresses, package update counts, and **automatic dynamic discovery of Cockpit Web UI**.
@@ -167,7 +167,8 @@ When your shell starts, `~/.bashrc` executes a minimal loader loop that sources
| Action | Flags / Aliases | Arguments | Description |
| :--- | :--- | :--- | :--- |
| **List** | `-l`, `--list`, `list` | *none* | Lists all scripts with IDs, names, and active status (`-` in blue) |
| **Preview** | `-p`, `-v`, `--cat`, `--show`, `cat` | `<id\|name ...>` | Prints script code with line numbers without opening an editor |
| **Preview (Numbered)** | `-p`, `--preview`, `preview` | `<id\|name ...>` | Prints script code with line numbers and status headers |
| **Cat / View (Plain)** | `-v`, `--cat`, `--view`, `--show`, `cat`, `view` | `<id\|name ...>` | Prints clean script code without line numbers |
| **Enable** | `-e`, `--enable`, `enable` | `<id\|name ...>` | Activates one or more scripts by creating symlinks in `scripts-enabled/` |
| **Disable** | `-d`, `--disable`, `disable` | `<id\|name ...>` | Deactivates one or more scripts by removing symlinks |
| **Enable All** | `-ea`, `--enable-all`, `enable-all` | *none* | Enables all available scripts at once |
@@ -221,13 +222,15 @@ brc-script -d 2 4 5
brc-script -d 03_bashboard 04_aliases
```
#### 4. Previewing Script Code Directly in Terminal
#### 4. Previewing and Catting Script Code Directly in Terminal
Inspect what a script does before enabling it:
```bash
# Preview using numeric ID
# Preview with line numbers and header info
brc-script -p 4
brc-script --preview 03_bashboard
# Preview using script name
# Cat clean code without line numbers (easy to copy & paste)
brc-script -v 4
brc-script --cat 03_bashboard
```