We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7050a31 + 0154408 commit 3e85f46Copy full SHA for 3e85f46
scripts/bash/create-new-feature.sh
@@ -5,20 +5,26 @@ set -e
5
JSON_MODE=false
6
SHORT_NAME=""
7
ARGS=()
8
-i=0
+i=1
9
while [ $i -le $# ]; do
10
arg="${!i}"
11
case "$arg" in
12
--json)
13
JSON_MODE=true
14
;;
15
--short-name)
16
- if [ $((i + 1)) -ge $# ]; then
+ if [ $((i + 1)) -gt $# ]; then
17
echo 'Error: --short-name requires a value' >&2
18
exit 1
19
fi
20
i=$((i + 1))
21
- SHORT_NAME="${!i}"
+ next_arg="${!i}"
22
+ # Check if the next argument is another option (starts with --)
23
+ if [[ "$next_arg" == --* ]]; then
24
+ echo 'Error: --short-name requires a value' >&2
25
+ exit 1
26
+ fi
27
+ SHORT_NAME="$next_arg"
28
29
--help|-h)
30
echo "Usage: $0 [--json] [--short-name <name>] <feature_description>"
0 commit comments