Skip to content

Commit 10a6afc

Browse files
committed
added options help
1 parent 4a11cd9 commit 10a6afc

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

ai.sh

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,26 @@
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

1529
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
1630

0 commit comments

Comments
 (0)