Skip to content

Commit 6699473

Browse files
committed
Don't permit unknown params
1 parent 3af1b28 commit 6699473

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/zsh/functions/wiggum

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ wiggum() {
77
custom_prompt="$2"
88
shift 2
99
;;
10-
--no-git)
10+
--no-commit|--no-git)
1111
no_git=1
1212
shift
1313
;;
@@ -19,8 +19,15 @@ wiggum() {
1919
model="$2"
2020
shift 2
2121
;;
22+
-*)
23+
echo "Error: Unknown option '$1'"
24+
echo "Usage: wiggum [-p|--prompt <file>] [-i|--iterations <n>] [-m|--model <model>] [--no-commit]"
25+
return 1
26+
;;
2227
*)
23-
shift
28+
echo "Error: Unexpected argument '$1'"
29+
echo "Usage: wiggum [-p|--prompt <file>] [-i|--iterations <n>] [-m|--model <model>] [--no-commit]"
30+
return 1
2431
;;
2532
esac
2633
done

0 commit comments

Comments
 (0)