Commit Graph

15 Commits

Author SHA1 Message Date
den (work)
2508d926c0 Fixes #975 2025-10-21 16:11:03 -07:00
Den Delimarsky
015440838a Merge branch 'main' into create-new-feature 2025-10-18 20:04:37 -07:00
Peter Wang
74f7e508a4 Change loop condition to include last argument
The last argument is not processed. 
e.g. create-new-feature.sh -h doesn't show the help information.
2025-10-17 09:03:47 +08:00
hongxuww
b37a9516d0 fix: correct argument parsing in create-new-feature.sh script
Fix two critical bugs in the argument parsing logic that caused incorrect
behavior when --short-name parameter was used:

1. **Index offset bug**: The loop started at i=0 and used i < $#, which
   incorrectly processed $0 (script name) as the first argument and
   skipped the last actual parameter. Changed to i=1 and i <= $# to
   properly iterate through actual command-line arguments ($1 to $#).

2. **Boundary condition bug**: The condition `[ $((i + 1)) -ge $# ]`
   incorrectly flagged valid arguments as missing. When --short-name was
   at position $#-1, the next position $# was valid but treated as
   out-of-bounds. Changed to `[ $((i + 1)) -gt $# ]` for correct validation.

3. **Enhanced validation**: Added check to ensure --short-name value is
   not another option (doesn't start with --).

**Before**:
- `script --json "desc" --short-name "test"` → Error: requires a value
- `script --json "desc1" "desc2" --short-name` → Generated wrong branch name

**After**:
- `script --json "desc" --short-name "test"` → Works correctly
- `script --json "desc1" "desc2" --short-name` → Proper error message

This ensures the script correctly supports both parameter orders:
- `[--json] [--short-name <name>] <feature_description>`
- `[--json] <feature_description> [--short-name <name>]`
2025-10-16 10:02:53 +00:00
Den Delimarsky
a945077b8d Update scripts/bash/create-new-feature.sh
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-14 23:39:50 -07:00
den (work)
4522fb4c44 Update create-new-feature.sh 2025-10-14 11:54:48 -07:00
den (work)
36ff7e6505 Update files 2025-10-14 11:52:26 -07:00
den (work)
36383b411f Update script logic 2025-10-14 10:55:54 -07:00
danyow
e642acaea4 Update template path for spec file creation 2025-09-24 21:30:22 +08:00
Den Delimarsky 🌺
3bdb1d9f3f Root detection logic 2025-09-20 20:14:11 -07:00
Den Delimarsky 🌺
1a71b03195 Script and template tweaks 2025-09-20 15:04:25 -07:00
Den Delimarsky 🌺
2d242b4732 Update config 2025-09-20 13:57:05 -07:00
Den Delimarsky 🌺
64171ec062 Use proper line endings 2025-09-20 11:38:04 -07:00
honjo-hiroaki-gtt
65ccbb62ca Enhance Codex support by auto-syncing prompt files, allowing spec generation without git, and documenting clearer /specify usage. 2025-09-20 22:44:44 +09:00
Den Delimarsky 🌺
5787bb5537 Refactor with platform-specific constraints 2025-09-12 10:27:43 -07:00