|
13 | 13 | */ |
14 | 14 | #include "fossil/io/parser.h" |
15 | 15 | #include "fossil/io/output.h" |
| 16 | +#include "fossil/io/cstring.h" |
16 | 17 | #include <stdio.h> |
17 | 18 | #include <stdlib.h> |
18 | 19 | #include <limits.h> |
@@ -204,6 +205,7 @@ void show_help(const char *command_name, const fossil_io_parser_palette_t *palet |
204 | 205 | fossil_io_printf("{cyan} --version: Display the version of the application.{reset}\n"); |
205 | 206 | fossil_io_printf("{cyan} --dry-run: Simulate the operation without making changes.{reset}\n"); |
206 | 207 | fossil_io_printf("{cyan} --verbose: Provide detailed output during execution.{reset}\n"); |
| 208 | + fossil_io_printf("{cyan} --color=[enable|disable|auto]: Control colored output (default: auto).{reset}\n"); |
207 | 209 | return; |
208 | 210 | } |
209 | 211 | command = command->next; |
@@ -424,11 +426,11 @@ void fossil_io_parser_parse(fossil_io_parser_palette_t *palette, int argc, char |
424 | 426 | } |
425 | 427 |
|
426 | 428 | if (strncmp(argv[i], "color=", 6) == 0) { |
427 | | - if (fossil_io_cstr_compare(argv[i] + 6, "enable") == 0) { |
| 429 | + if (fossil_io_cstring_compare(argv[i] + 6, "enable") == 0) { |
428 | 430 | FOSSIL_IO_COLOR_ENABLE = 1; |
429 | | - } else if (fossil_io_cstr_compare(argv[i] + 6, "disable") == 0) { |
| 431 | + } else if (fossil_io_cstring_compare(argv[i] + 6, "disable") == 0) { |
430 | 432 | FOSSIL_IO_COLOR_ENABLE = 0; |
431 | | - } else if (fossil_io_cstr_compare(argv[i] + 6, "auto") == 0) { |
| 433 | + } else if (fossil_io_cstring_compare(argv[i] + 6, "auto") == 0) { |
432 | 434 | if (isatty(STDOUT_FILENO)) { |
433 | 435 | FOSSIL_IO_COLOR_ENABLE = 1; |
434 | 436 | } else { |
|
0 commit comments