Commit c8ae940
authored
Add output argument to control file creation vs console output in generate command (#59)
## Description
This PR adds support for an `--output` argument to the generate command,
allowing users to choose between creating files on disk (`file` mode,
default) or printing the generated file paths and contents to the
console (`console` mode). This is useful for testing and previewing
structure generation without making changes to the filesystem.
- When `--output console` is set, no files or directories are created.
Instead, the tool prints what would be created.
- When `--output file` (default), the tool behaves as before, creating
files and directories as specified.
## Issue Addressed
- Implements feature request for dry-run/preview mode via console
output.
## Additional Context
- Directory creation and file writing are both skipped in console mode.
- Logging and output are updated to reflect the chosen mode.
## Checklist
- [x] Follows coding standards and contributing guidelines
- [x] Adds or updates tests as needed
- [x] Documentation updated if required
- [x] Manually tested both output modes
---
Please review and provide feedback or merge if approved.1 parent 04e9b4c commit c8ae940
File tree
3 files changed
+25
-17
lines changed- .github/workflows
- struct_module/commands
3 files changed
+25
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
174 | 182 | | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
| |||
0 commit comments