Skip to content

Commit 837723b

Browse files
Update parser.c
1 parent 82aec8f commit 837723b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

code/logic/parser.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414
#include "fossil/io/parser.h"
1515
#include "fossil/io/output.h"
16+
#include "fossil/io/cstring.h"
1617
#include <stdio.h>
1718
#include <stdlib.h>
1819
#include <limits.h>
@@ -204,6 +205,7 @@ void show_help(const char *command_name, const fossil_io_parser_palette_t *palet
204205
fossil_io_printf("{cyan} --version: Display the version of the application.{reset}\n");
205206
fossil_io_printf("{cyan} --dry-run: Simulate the operation without making changes.{reset}\n");
206207
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");
207209
return;
208210
}
209211
command = command->next;
@@ -424,11 +426,11 @@ void fossil_io_parser_parse(fossil_io_parser_palette_t *palette, int argc, char
424426
}
425427

426428
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) {
428430
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) {
430432
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) {
432434
if (isatty(STDOUT_FILENO)) {
433435
FOSSIL_IO_COLOR_ENABLE = 1;
434436
} else {

0 commit comments

Comments
 (0)