mirror of
https://github.com/github/spec-kit.git
synced 2026-01-31 21:13:36 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e85f46465 | ||
|
|
015440838a | ||
|
|
b37a9516d0 |
@@ -5,7 +5,7 @@ set -e
|
|||||||
JSON_MODE=false
|
JSON_MODE=false
|
||||||
SHORT_NAME=""
|
SHORT_NAME=""
|
||||||
ARGS=()
|
ARGS=()
|
||||||
i=0
|
i=1
|
||||||
while [ $i -le $# ]; do
|
while [ $i -le $# ]; do
|
||||||
arg="${!i}"
|
arg="${!i}"
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
@@ -13,12 +13,18 @@ while [ $i -le $# ]; do
|
|||||||
JSON_MODE=true
|
JSON_MODE=true
|
||||||
;;
|
;;
|
||||||
--short-name)
|
--short-name)
|
||||||
if [ $((i + 1)) -ge $# ]; then
|
if [ $((i + 1)) -gt $# ]; then
|
||||||
echo 'Error: --short-name requires a value' >&2
|
echo 'Error: --short-name requires a value' >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
i=$((i + 1))
|
i=$((i + 1))
|
||||||
SHORT_NAME="${!i}"
|
next_arg="${!i}"
|
||||||
|
# Check if the next argument is another option (starts with --)
|
||||||
|
if [[ "$next_arg" == --* ]]; then
|
||||||
|
echo 'Error: --short-name requires a value' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SHORT_NAME="$next_arg"
|
||||||
;;
|
;;
|
||||||
--help|-h)
|
--help|-h)
|
||||||
echo "Usage: $0 [--json] [--short-name <name>] <feature_description>"
|
echo "Usage: $0 [--json] [--short-name <name>] <feature_description>"
|
||||||
|
|||||||
Reference in New Issue
Block a user