#!/usr/bin/env bash set -Eeuo pipefail usage() { cat <<'EOF' Quicksh dev 0.1.0 — Workstation information and setup guidance Usage: bash dev.sh [--help|-h|--version] Reports the OS, executing shell, configured login shell, and tool availability. Missing tools are informational; this script never installs anything. Arch Linux and Ubuntu receive setup guidance. Other systems receive a report. --install is not implemented here: review arch.sh or ubuntu.sh separately. EOF } main() { if (( $# > 1 )); then printf 'quicksh dev: expected at most one option. Use --help.\n' >&2 return 2 fi case "${1:-}" in --help|-h) usage; return ;; --version) printf 'Quicksh dev 0.1.0\n'; return ;; '') ;; *) printf 'quicksh dev: unsupported option: %s. Use --help.\n' "$1" >&2; return 2 ;; esac local ID=unknown PRETTY_NAME='Unknown system' if [[ -r /etc/os-release ]]; then # shellcheck disable=SC1091 if ! . /etc/os-release; then printf 'quicksh dev: could not read OS identification.\n' >&2 return 1 fi fi printf 'Quicksh dev 0.1.0\nOS: %s\n' "$PRETTY_NAME" printf 'Executing shell: Bash %s\nConfigured login shell (SHELL): %s\n' \ "$BASH_VERSION" "${SHELL:-unknown}" printf 'The login shell may differ from the shell that launched this script.\n\n' local tool path local -a missing=() printf 'Developer essentials:\n' for tool in bash git curl make cc; do if path=$(command -v "$tool"); then printf ' [ok] %-10s %s\n' "$tool" "$path" else printf ' [missing] %s\n' "$tool" missing+=("$tool") fi done if (( ${#missing[@]} )); then printf '\nMissing essentials: %s\n' "${missing[*]}" else printf '\nAll checked essentials are available.\n' fi printf '\nOptional tools (not installed by the essentials helpers):\n' for tool in jq python3 node docker kubectl shellcheck; do if command -v "$tool" >/dev/null 2>&1; then printf ' [ok] %s\n' "$tool" else printf ' [missing] %s\n' "$tool" fi done printf '\nSetup guidance:\n' case "$ID" in arch) printf ' Review arch.sh --packages, then arch.sh --install if needed.\n' ;; ubuntu) printf ' Review ubuntu.sh --packages, then ubuntu.sh --install if needed.\n' ;; *) printf ' No installation guidance for this OS. Use its official documentation.\n' ;; esac printf 'Download and inspect the appropriate helper separately; nothing is fetched here.\n' } main "$@"