Skip to content

Commit df5f89e

Browse files
committed
Updated README, refs #1
1 parent 4407ac5 commit df5f89e

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ Install this tool using `pip`:
1313
```bash
1414
pip install files-to-prompt
1515
```
16+
1617
## Usage
1718

18-
To use `files-to-prompt`, provide the path to the directory you want to process:
19+
To use `files-to-prompt`, provide the path to one or more files or directories you want to process:
1920

2021
```bash
21-
files-to-prompt path/to/directory
22+
files-to-prompt path/to/file_or_directory [path/to/another/file_or_directory ...]
2223
```
2324

24-
This will output the contents of every file in the directory and its subdirectories, with each file preceded by its relative path and separated by `---`.
25+
This will output the contents of every file, with each file preceded by its relative path and separated by `---`.
2526

2627
### Options
2728

@@ -35,6 +36,11 @@ This will output the contents of every file in the directory and its subdirector
3536
files-to-prompt path/to/directory --ignore-gitignore
3637
```
3738

39+
- `--ignore <pattern>`: Specify one or more patterns to ignore. Can be used multiple times.
40+
```bash
41+
files-to-prompt path/to/directory --ignore "*.log" --ignore "temp*"
42+
```
43+
3844
### Example
3945

4046
Suppose you have a directory structure like this:
@@ -44,6 +50,7 @@ my_directory/
4450
├── file1.txt
4551
├── file2.txt
4652
├── .hidden_file.txt
53+
├── temp.log
4754
└── subdirectory/
4855
└── file3.txt
4956
```
@@ -74,19 +81,41 @@ Contents of .hidden_file.txt
7481
---
7582
...
7683
```
84+
85+
If you run `files-to-prompt my_directory --ignore "*.log"`, the output will exclude `temp.log`:
86+
87+
```
88+
my_directory/file1.txt
89+
---
90+
Contents of file1.txt
91+
---
92+
my_directory/file2.txt
93+
---
94+
Contents of file2.txt
95+
---
96+
my_directory/subdirectory/file3.txt
97+
---
98+
Contents of file3.txt
99+
---
100+
```
101+
77102
## Development
78103

79104
To contribute to this tool, first checkout the code. Then create a new virtual environment:
105+
80106
```bash
81107
cd files-to-prompt
82108
python -m venv venv
83109
source venv/bin/activate
84110
```
111+
85112
Now install the dependencies and test dependencies:
113+
86114
```bash
87115
pip install -e '.[test]'
88116
```
117+
89118
To run the tests:
90119
```bash
91120
pytest
92-
```
121+
```

0 commit comments

Comments
 (0)