Commit 6d7f3ec
feat: implement glob expansion (Phase 6 M12)
Milestone 12 complete: POSIX-compliant glob expansion for wildcards,
character classes, and brace expansion.
## New Module
- src/glob.rs (~300 lines):
- contains_glob_pattern(): Detects *, ?, [, { metacharacters
- expand_glob(): Pattern matching via glob crate (POSIX-compliant)
- expand_braces(): Brace expansion {a,b,c} with recursive nesting
- split_brace_content(): Helper for parsing nested braces
- 8 unit tests (all passing)
## Integration
- src/external.rs:
- expand_glob_args(): Expands arguments before command execution
- Brace expansion → glob expansion pipeline
- Empty matches return literal (POSIX behavior)
- Uses current working directory for relative paths
## Testing
- tests/integration_test.rs:
- 9 comprehensive integration tests covering:
- Wildcard expansion (*.txt)
- Question mark expansion (file?.rs)
- Brace expansion (file{1,2,3}.txt)
- Character class expansion ([0-9])
- Hidden file handling (.* required)
- Empty match literal fallback
- Multiple argument expansion
## Dependencies
- Added glob = "0.3" to Cargo.toml for POSIX pattern matching
- All tests passing (8 unit + 9 integration)
- Library compiles successfully
## State Updates
- STATE.scm:
- Overall completion: 82% → 85%
- Phase: M10 Complete → M12 Complete
- Removed "Glob expansion not implemented" blocker
- Added glob expansion to working-features
- Added session history entry
## Documentation
- docs/PHASE6_M12_DESIGN.md: Complete design document
Phase 6 progress: 12/14 milestones complete (85%)
Next: M13 Quote processing, M14 Full POSIX compliance
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>1 parent 2b3e3ab commit 6d7f3ec
File tree
8 files changed
+1782
-20
lines changed- docs
- impl/rust-cli
- src
- tests
8 files changed
+1782
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
227 | 255 | | |
228 | 256 | | |
229 | 257 | | |
| |||
0 commit comments