File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 55# Optional: Run with DEBUG=true to enable detailed error debugging, e.g.:
66# DEBUG=true ./ai.sh
77
8- # Update option: run git pull and exit
9- if [[ " $1 " == " --update" ]]; then
10- echo " 🔄 Updating ai.sh to the latest version..."
11- cd " $SCRIPT_DIR " && git pull
12- exit $?
13- fi
8+
9+ # Option handling with case statement
10+ case " $1 " in
11+ -u|--update)
12+ echo " 🔄 Updating ai.sh to the latest version..."
13+ cd " $SCRIPT_DIR " && git pull
14+ exit $?
15+ ;;
16+ -h|--help)
17+ echo -e " \nOpenRouter CLI Chat Usage:\n"
18+ echo " ./ai.sh Start interactive chat"
19+ echo " ./ai.sh --update Update repository (git pull)"
20+ echo " ./ai.sh -h, --help Show this help message"
21+ echo -e " \nEnvironment setup:"
22+ echo " cp .env.example .env # Create your .env file"
23+ echo " Edit .env and add your OPENROUTER_API_KEY and optionally OPENROUTER_MODEL."
24+ echo " See .models for available models."
25+ exit 0
26+ ;;
27+ esac
1428
1529SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
1630
You can’t perform that action at this time.
0 commit comments