Add colors to the --config output#2584
Conversation
…fig items changed from their default value are now shown in red, similarly to how we do it in the debug log Signed-off-by: DL6ER <dl6er@dl6er.de>
There was a problem hiding this comment.
Pull Request Overview
This PR adds colorful output to the CLI --config command to highlight configuration items that have been changed from their default values. Config items that differ from defaults are now shown in red, making it easier to identify active customizations, particularly for debug flags.
- Adds color constants and CLI color functions to the public API
- Implements conditional red coloring for non-default config values in CLI output
- Moves color definitions from implementation file to header for reusability
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/config/cli.c | Implements red coloring for config keys that differ from default values |
| src/args.h | Adds color constants and exposes cli_color function for use across modules |
| src/args.c | Makes cli_color function public and moves color definitions to header |
yubiuser
left a comment
There was a problem hiding this comment.
Can you amend the pihole-FTL --help text for --config with an explanation what the items in red mean. (Not to confuse users with red=warning/error assumption)
|
Not sure why this is happening, detecting whether the color is to be added (i.e. if it is an interactive shell) seems to work, e.g.: No color with Colorful output with edit I found the bug in the core component, please try this together with |
Signed-off-by: DL6ER <dl6er@dl6er.de>
74cf674 to
191aaad
Compare
Signed-off-by: DL6ER <dl6er@dl6er.de>
What does this implement/fix?
Add colorful output to CLI if running in an interactive terminal. Config items changed from their default value are now shown in red, similarly to how we do it in the debug log. This makes reading settings much easier, especially if you want to see which
debugflags are enabled, e.g.Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase)Checklist:
developmentbranch.