#! /usr/bin/env bash

# Defines command line prompt options.

# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

# Label: Process Option
# Description: Run script based on selection.
# Parameters: $1 (required): The option to process.
process_option() {
  case $1 in
    'b')
      bin/install_basics;;
    't')
      bin/install_dev_tools;;
    'hf')
      bin/install_homebrew_formulas;;
    'hc')
      bin/install_homebrew_casks;;
    'm')
      bin/install_app_store;;
    's')
      bin/configure_macos;;
    'i')
      caffeinate_machine
      bin/install_basics
      bin/install_dev_tools
      bin/install_homebrew_formulas
      bin/install_homebrew_casks
      bin/install_app_store
      bin/configure_macos
      clean_work_path
      printf "\n🎉 ${GREEN}Installation Complete!${NC}\n\n"
      printf "✅ All software has been installed successfully!\n\n"
      printf "${YELLOW}Next steps:${NC}\n"
      printf "  • Restart your terminal to use Homebrew commands\n"
      printf "  • Configure installed applications as needed\n"
      printf "  • Run 'bin/run c' to check installation status\n\n"
      printf "${GREEN}Enjoy your new macOS setup!${NC}\n\n";;
   'c')
      verify_homebrew_formulas
      verify_homebrew_casks
      verify_app_store_applications;;
    'C')
      caffeinate_machine;;
    'w')
      clean_work_path;;
    'q');;
    *)
      printf "ERROR: Invalid option.\n";;
  esac
}
export -f process_option
