Skip to content

Commit 6451200

Browse files
Update README.md
1 parent a0c85ca commit 6451200

File tree

3 files changed

+77
-188
lines changed

3 files changed

+77
-188
lines changed

README.md

+77-188
Original file line numberDiff line numberDiff line change
@@ -1,236 +1,125 @@
1-
# PrintLayout
1+
# PrintLayout 🌳
22

3-
![PrintLayout Logo](assets/printlayoutlogo.webp)
3+
![PrintLayout Logo](assets/image.png)
44

5-
PrintLayout is a command-line tool that prints the directory structure of a specified folder in a tree format. It is designed to be simple, fast, and customizable.
5+
PrintLayout is a powerful, customizable command-line tool for printing directory structures in a tree format. Built with Go for simplicity and performance, it offers extensive features for visualizing and exploring file systems.
66

7-
## Installation
7+
## 🚀 Installation
88

9-
### Option 1: Download Pre-Built Binaries
9+
### Pre-Built Binaries
1010

11-
Download the pre-built binary for your operating system from the [Releases page](https://github.com/Ahmedhossamdev/PrintLayout/releases).
11+
Download the appropriate binary for your operating system from the [Releases page](https://github.com/Ahmedhossamdev/PrintLayout/releases).
1212

1313
#### Linux/macOS
14+
```bash
15+
# Download binary
16+
chmod +x pr-linux-amd64
17+
sudo mv pr-linux-amd64 /usr/local/bin/pr
1418

15-
1. Download the binary for your platform (e.g., `printlayout-linux-amd64` or `printlayout-darwin-amd64`).
16-
2. Make the binary executable:
17-
3.
18-
```bash
19-
chmod +x printlayout-linux-amd64
20-
```
21-
4. Move the binary to a directory in your `PATH` (e.g., `/usr/local/bin`):
22-
5.
23-
```bash
24-
sudo mv printlayout-linux-amd64 /usr/local/bin/printlayout
25-
```
26-
6. Run the program:
27-
7.
28-
```bash
29-
pr -dir /path/to/your/folder or pr to print the current dir
30-
```
19+
# Run
20+
pr -dir /path/to/your/folder
21+
```
3122

3223
#### Windows
24+
1. Download `pr-windows-amd64.exe`
25+
2. Move to a directory in your `PATH`
3326

34-
1. Download the binary for your platform (e.g., `printlayout-windows-amd64.exe`).
35-
2. Move the binary to a directory in your `PATH` (e.g., `C:\Windows\System32`).
27+
## 📋 Command-Line Flags
3628

37-
## Usage
29+
### Basic Flags
3830

39-
### Print the Directory Structure
31+
| Flag | Description | Default | Example |
32+
|------|-------------|---------|---------|
33+
| `--dir` | Specify directory to print | Current directory | `pr --dir /path/to/folder` |
34+
| `--ext` | Filter files by extension | All files | `pr --ext .go` |
35+
| `--output` | Save output to file | Terminal output | `pr --output output.txt` |
36+
| `--no-color` | Disable colored output | Colors enabled | `pr --no-color` |
4037

41-
To print the directory structure of the current folder:
38+
### Sorting Flags
4239

43-
```bash
44-
pr
45-
```
40+
| Flag | Description | Options | Default | Example |
41+
|------|-------------|---------|---------|---------|
42+
| `--sort-by` | Sort criteria | `name`, `size`, `time` | `name` | `pr --sort-by size` |
43+
| `--order` | Sorting order | `asc`, `desc` | `asc` | `pr --sort-by time --order desc` |
4644

47-
To print the directory structure of a specific folder:****
45+
### Exclusion Flags
4846

49-
```bash
50-
pr -dir /path/to/your/folder
51-
```
47+
| Flag | Description | Default | Example |
48+
|------|-------------|---------|---------|
49+
| `--exclude` | Exclude files/dirs matching pattern | No exclusions | `pr --exclude "*.log"` |
5250

53-
To print the directory structure and filter by a specific file extension (e.g., .go, .js, .rb):
51+
### Output Format Flags
5452

55-
```bash
56-
pr -ext .js
57-
```
53+
| Flag | Description | Options | Default | Example |
54+
|------|-------------|---------|---------|---------|
55+
| `--format` | Output format | `text`, `json`, `xml`, `yaml` | `text` | `pr --format json` |
5856

59-
To print the directory structure of a specific folder, filter by a specific file extension, and save the output to a file:
57+
### Color Customization Flags
6058

61-
```bash
62-
pr -dir /path/to/your/folder -ext .rb -output output.txt
63-
```
59+
| Flag | Description | Options | Default | Example |
60+
|------|-------------|---------|---------|---------|
61+
| `--dir-color` | Directory color | `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white` | `blue` | `pr --dir-color green` |
62+
| `--file-color` | File color | Same as above | `green` | `pr --file-color yellow` |
63+
| `--exec-color` | Executable file color | Same as above | `red` | `pr --exec-color magenta` |
6464

65-
### Example Output
65+
### Supported Colors (We will add more)
6666

67-
```bash
68-
$ pr -dir /path/to/your/folder
69-
printLayout/
70-
├── cmd/
71-
│ └── main.go
72-
├── go.mod
73-
├── internal/
74-
│ └── utils/
75-
│ └── utils.go
76-
└── pkg/
77-
└── printer/
78-
├── printer.go
79-
└── printer_test.go
80-
```
67+
printLayout supports the following colors for customization:
8168

82-
# `pr` Command-Line Flags
83-
84-
## Basic Flags
85-
86-
### `--dir`
87-
- **Description**: Specifies the directory to print the structure of.
88-
- **Default**: Current directory (`.`)
89-
- **Example**: `pr --dir /path/to/your/folder`
90-
91-
### `--ext`
92-
- **Description**: Filters files by a specific extension (e.g., `.go`, `.js`)
93-
- **Default**: No filter (all files are included)
94-
- **Example**: `pr --ext .go`
95-
96-
### `--output`
97-
- **Description**: Saves the output to a file instead of printing it to the terminal
98-
- **Default**: Output is printed to the terminal
99-
- **Example**: `pr --output output.txt`
100-
101-
### `--no-color`
102-
- **Description**: Disables colored output
103-
- **Default**: Colors are enabled
104-
- **Example**: `pr --no-color`
105-
106-
## Sorting Flags
107-
108-
### `--sort-by`
109-
- **Description**: Specifies the sorting criteria
110-
- **Options**:
111-
- `name`: Sort by file/directory name
112-
- `size`: Sort by file size
113-
- `time`: Sort by modification time
114-
- **Default**: `name`
115-
- **Example**: `pr --sort-by size`
116-
117-
### `--order`
118-
- **Description**: Specifies the sorting order
119-
- **Options**:
120-
- `asc`: Ascending order
121-
- `desc`: Descending order
122-
- **Default**: `asc`
123-
- **Example**: `pr --sort-by time --order desc`
124-
125-
## Exclusion Flags
126-
127-
### `--exclude`
128-
- **Description**: Excludes files or directories matching the specified pattern (can be used multiple times)
129-
- **Default**: No exclusions
130-
- **Example**: `pr --exclude "*.log" --exclude "tmp/*"`
131-
132-
## Output Format Flags
133-
134-
### `--format`
135-
- **Description**: Specifies the output format
136-
- **Options**:
137-
- `text`: Plain text format (default)
138-
- `json`: JSON format
139-
- `xml`: XML format
140-
- `yaml`: YAML format
141-
- **Default**: `text`
142-
- **Example**: `pr --format json`
143-
144-
## Color Customization Flags
145-
146-
### `--dir-color`
147-
- **Description**: Specifies the color for directories
148-
- **Options**: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
149-
- **Default**: `blue`
150-
- **Example**: `pr --dir-color green`
151-
152-
### `--file-color`
153-
- **Description**: Specifies the color for files
154-
- **Options**: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
155-
- **Default**: `green`
156-
- **Example**: `pr --file-color yellow`
157-
158-
### `--exec-color`
159-
- **Description**: Specifies the color for executable files
160-
- **Options**: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`
161-
- **Default**: `red`
162-
- **Example**: `pr --exec-color magenta`
163-
164-
## Help Flag
165-
166-
### `--help` or `-h`
167-
- **Description**: Displays the help message with all available flags and usage examples
168-
- **Example**: `pr --help`
169-
170-
## Combined Flags Example
69+
- `black`
70+
- `red`
71+
- `green`
72+
- `yellow`
73+
- `blue`
74+
- `magenta`
75+
- `cyan`
76+
- `white`
17177

78+
## 🔍 Basic Examples
79+
80+
### 1. Print the current directory structure
17281
```bash
173-
pr --dir /path/to/your/folder --ext .go --sort-by size --order desc --output output.txt --no-color
82+
pr
83+
```
84+
### 2. Specify a directory to explore
85+
```bash
86+
pr --dir ./path/to/project
17487
```
17588

176-
## Development
177-
178-
### Run the Project in Development
89+
### 3.Combined flags
90+
```bash
91+
pr --dir /path/to/project --ext .ts --sort-by size --order desc --exclude "node_modules" --exclude "*.test" --dir-color magenta --file-color cyan --output project_structure.txt
92+
```
17993

180-
To run the project during development without installing it:
94+
## 🛠 Development
18195

96+
### Run Project
18297
```bash
18398
go run ./cmd/main.go
18499
```
185100

186101
### Run Tests
187-
188-
To run the tests:
189-
190102
```bash
191103
go test -v ./...
192104
```
193105

194-
### Build the Project
195-
196-
To build the project:
197-
106+
### Build Project
198107
```bash
199108
go build -o printlayout ./cmd/main.go
200109
```
201110

202-
This will create an executable named printlayout in your project directory.
203-
204-
## Future Improvements (TODOs)
205-
206-
Here are some ideas for future improvements to the project:
207-
208-
1. Advanced Command-Line Options:
209-
210-
- [ ] Add support for limiting the depth of the directory tree (e.g., --depth 2).
211-
- [ ] an option to include hidden files and directories (e.g., --hidden).
212-
- [ ] an option to ignore files and directories listed in .gitignore (e.g., --ignore-gitignore).
213-
214-
2. Customizable Output:
215-
216-
- [ ] support for customizing the tree symbols (e.g., --symbols=ascii for ASCII-only output).
217-
- [x] support for exporting the directory structure to a file (e.g., --output tree.txt).
218-
219-
3. Performance Improvements:
220-
- [ ] Optimize the directory traversal for large directories.
221-
- [ ] Add support for parallel processing of directories.
222-
223-
## Contributing
111+
## 🤝 Contributing
224112

225-
Contributions are welcome! If you'd like to contribute, please follow these steps:
113+
1. Fork the repository
114+
2. Create a feature branch
115+
3. Commit changes
116+
4. Push and submit a pull request
226117

227-
1. Fork the repository.
228-
2. Create a new branch for your feature or bugfix.
229-
3. Make your changes and write tests if applicable.
230-
4. Submit a pull request with a detailed description of your changes.
118+
## 📜 License
231119

120+
I don't know about License stuff, but this project made by me
232121

233-
## Acknowledgments
122+
## 🙏 Acknowledgments
234123

235-
- Built with Go for simplicity and performance.
236-
- Inspired by GNU Tree: Incorporating all the features of GNU Tree while innovating with new functionalities to enhance the user experience.
124+
- Built with Go
125+
- Inspired by GNU Tree

assets/image.png

525 KB
Loading

assets/printlayoutlogo.webp

-211 KB
Binary file not shown.

0 commit comments

Comments
 (0)