Commit 27c076d
committed
feat: add TOML configuration file support with JSON backward compatibility
- Add toml dependency for dual format support
- Implement automatic format detection based on file extension
- Add smart config file discovery (TOML preferred, JSON fallback)
- Maintain full backward compatibility with existing JSON configs
- Default new installations to TOML format for better readability
- Update config path handling to support both extensions
- Add comprehensive tests for both TOML and JSON formats
- Update documentation with dual format examples and migration info
- Mark issue #17 as complete in ROADMAP
All acceptance criteria fulfilled:
✅ Creates default config file if not exists (TOML format)
✅ Loads printer settings from config (both formats)
✅ CLI arguments override config values (preserved functionality)
✅ Validates configuration format (format-specific error messages)
✅ Clear error messages for invalid config (JSON/TOML specific)
Resolves #171 parent afcdfce commit 27c076d
6 files changed
Lines changed: 329 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
285 | 294 | | |
286 | 295 | | |
287 | 296 | | |
288 | | - | |
| 297 | + | |
289 | 298 | | |
290 | | - | |
291 | | - | |
292 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
293 | 302 | | |
294 | 303 | | |
295 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
296 | 328 | | |
297 | 329 | | |
298 | 330 | | |
| |||
326 | 358 | | |
327 | 359 | | |
328 | 360 | | |
329 | | - | |
| 361 | + | |
330 | 362 | | |
331 | 363 | | |
332 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
| |||
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
80 | 94 | | |
| 95 | + | |
81 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
82 | 101 | | |
83 | 102 | | |
84 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
85 | 124 | | |
86 | 125 | | |
87 | 126 | | |
88 | | - | |
89 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
90 | 137 | | |
91 | 138 | | |
92 | 139 | | |
| |||
98 | 145 | | |
99 | 146 | | |
100 | 147 | | |
101 | | - | |
102 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
103 | 158 | | |
104 | 159 | | |
105 | 160 | | |
| |||
166 | 221 | | |
167 | 222 | | |
168 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
169 | 233 | | |
170 | 234 | | |
171 | | - | |
| 235 | + | |
172 | 236 | | |
173 | 237 | | |
174 | 238 | | |
175 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
176 | 242 | | |
177 | | - | |
| 243 | + | |
178 | 244 | | |
179 | 245 | | |
180 | 246 | | |
| |||
0 commit comments