diff options
| author | Craig Jennings <c@cjennings.net> | 2026-04-09 22:02:52 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-04-09 22:02:52 -0500 |
| commit | ee4a3f67f84609c144faad9ca54e74c2fee325c2 (patch) | |
| tree | 07cc85bceee233daaed48c4d2b657c4c6a531717 /installer | |
| parent | 057145e9b9f2106ad3284ce9c37ec6256a500538 (diff) | |
| download | archangel-ee4a3f67f84609c144faad9ca54e74c2fee325c2.tar.gz archangel-ee4a3f67f84609c144faad9ca54e74c2fee325c2.zip | |
feat: default to no-color output, add --color flag to enable
Keeps logs and SSH output clean. Use archangel --color for colored output.
Diffstat (limited to 'installer')
| -rw-r--r-- | installer/lib/common.sh | 22 | ||||
| -rw-r--r-- | installer/lib/config.sh | 5 |
2 files changed, 16 insertions, 11 deletions
diff --git a/installer/lib/common.sh b/installer/lib/common.sh index 0f02e37..4acd7b9 100644 --- a/installer/lib/common.sh +++ b/installer/lib/common.sh @@ -6,22 +6,22 @@ # Output Functions ############################# -# Colors (optional, gracefully degrade if not supported) -if [[ -t 1 ]]; then +# No color by default — use --color flag to enable +RED='' +GREEN='' +YELLOW='' +BLUE='' +BOLD='' +NC='' + +enable_color() { RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[0;33m' BLUE='\033[0;34m' BOLD='\033[1m' - NC='\033[0m' # No Color -else - RED='' - GREEN='' - YELLOW='' - BLUE='' - BOLD='' - NC='' -fi + NC='\033[0m' +} info() { echo -e "${GREEN}[INFO]${NC} $1"; } warn() { echo -e "${YELLOW}[WARN]${NC} $1"; } diff --git a/installer/lib/config.sh b/installer/lib/config.sh index 358a5f4..fefc838 100644 --- a/installer/lib/config.sh +++ b/installer/lib/config.sh @@ -41,6 +41,10 @@ parse_args() { error "--config-file requires a path argument" fi ;; + --color) + enable_color + shift + ;; --help|-h) show_usage exit 0 @@ -60,6 +64,7 @@ Arch Linux installer with ZFS/Btrfs support and snapshot management. Options: --config-file PATH Use config file for unattended installation + --color Enable colored output --help, -h Show this help message Without --config-file, runs in interactive mode. |
