Skip to content

Commit 0387f40

Browse files
authored
Update patterns.md
1 parent 7857a5f commit 0387f40

File tree

1 file changed

+21
-33
lines changed

1 file changed

+21
-33
lines changed

docs/patterns.md

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,9 @@
2828
- `settings.yaml`
2929
- `nested/data.json`
3030

31-
#### Match files in a specific subdirectory:
32-
33-
- **Pattern**: `src/*.go`
34-
- **Matches**:
35-
- `src/main.go`
36-
- `src/helpers.go`
37-
- **Does not match**:
38-
- `utils/test.go`
39-
4031
#### Recursive match for all `.txt` files in nested directories:
4132

42-
- **Pattern**: `**/*.txt`
33+
- **Pattern**: `*.txt`
4334
- **Matches**:
4435
- `logs/errors.txt`
4536
- `nested/directory/notes.txt`
@@ -141,70 +132,67 @@
141132

142133
```bash
143134
# Include all Go-related files
144-
filefusion -p "*.go,*.mod,*.sum" ./my-project
135+
filefusion -p "*.go,*.mod,*.sum" .
145136

146137
# Include Go files but exclude tests
147-
filefusion -p "*.go" -e "*_test.go" ./my-project
148-
149-
# Process only internal packages
150-
filefusion -p "internal/**/*.go" ./my-project
138+
filefusion -p "*.go" -e "*_test.go" .
151139
```
152140

153141
### Web Project
154142

155143
```bash
156144
# Process frontend source files
157-
filefusion -p "src/**/*.{js,ts,jsx,tsx,css,scss}" ./web-app
145+
filefusion -p "*.{js,ts,jsx,tsx,css,scss}" /src
158146

159147
# Include configuration but exclude build artifacts
160-
filefusion -p "*.{js,json,yaml,env}" -e "dist/**,build/**" ./web-app
148+
filefusion -p "*.{js,json,yaml,env}" -e "dist/**,build/**"
161149

162150
# Process only React components
163-
filefusion -p "src/components/**/*.{jsx,tsx}" ./web-app
151+
filefusion -p "*.{jsx,tsx}" src/components/
164152
```
165153

166154
### Complex Patterns
167155

168156
```bash
169157
# Multiple file types and exclusions
170158
filefusion \
171-
-p "*.go,internal/**/*.go,cmd/**/*.go,*.yaml,*.json" \
159+
-p "*.go,*.yaml,*.json" \
172160
-e "**/*_test.go,vendor/**,**/testdata/**" \
173-
./project
161+
internal cmd
162+
# will generate 2 output files internal.xml and cmd.xml
174163

175164
# Specific directory patterns with multiple exclusions
176165
filefusion \
177-
-p "src/**/*.{js,ts},config/*.{json,yaml},scripts/*.sh" \
178-
-e "**/*.test.{js,ts},**/__tests__/**,**/node_modules/**" \
179-
./web-app
166+
-p "*.{js,ts}, *.{json,yaml},*.sh" \
167+
-e "**/*.test.{js,ts},**/__tests__/**,**/node_modules/**"
180168

181169
# Documentation and configuration files
182170
filefusion \
183-
-p "docs/**/*.md,*.{yaml,yml,json},config/**/*" \
171+
-p "*.md,*.{yaml,yml,json}" \
184172
-e "**/draft/**,**/.git/**,private/**" \
185-
./project
173+
.
186174
```
187175

188176
### Language-Specific Examples
189177

190178
```bash
191179
# Python project
192180
filefusion \
193-
-p "**/*.{py,ipynb},requirements.txt,setup.py" \
181+
-p "*.{py,ipynb},requirements.txt,setup.py" \
194182
-e "**/__pycache__/**,**/*.pyc,venv/**" \
195-
./python-project
183+
.
196184

197185
# Java/Kotlin project
198186
filefusion \
199-
-p "src/**/*.{java,kt},build.gradle,pom.xml" \
187+
-p "*.{java,kt},build.gradle,pom.xml" \
200188
-e "**/build/**,**/target/**,**/*Test.{java,kt}" \
201-
./java-project
189+
. src
202190

203191
# Full-stack project
204192
filefusion \
205-
-p "backend/**/*.go,frontend/src/**/*.{ts,tsx},*.yaml" \
193+
-p "*.go,*.{ts,tsx},*.yaml" \
206194
-e "**/node_modules/**,**/dist/**,**/*_test.go" \
207-
./fullstack-app
195+
. backend frontend/src
208196
```
209197

210198
## ⚠️ Notes on Validation
@@ -214,9 +202,9 @@ filefusion \
214202
- **Pattern**: `***`
215203
- **Error**: "invalid pattern: contains invalid glob pattern '\*\*\*'"
216204

217-
### Glob Confusion
205+
### Glob Confusion
218206

219-
- **Valid**: `**/file.*`, `**/*.txt`
207+
- **Valid For Exclusion**: `**/file.*`, `**/*.txt`
220208
- **Invalid**: `***/*.txt` (returns an error)
221209

222210
---

0 commit comments

Comments
 (0)