Add option filter to +show-config action
#14179
What do you want to change?I'd like to implement feature #2486 which allows more granular config printing for the Please see the comparison. This implementation adds the ability to provide a list of option names for output filtering. Pattern matching is not implemented. Options preserve their original behaviour. # No filters. Prints the full user config.
ghostty +show-config
ghostty +show-config --
# No match. Prints nothing (exit code 0).
ghostty +show-config -- non-existent-option
# Prints identical output. Entries deduplicated and order-independent.
# Non-existent names ignored, and so are empty or whitespace-only arguments.
ghostty +show-config -- font-family font-size
ghostty +show-config -- font-size non-existent-option font-family font-size '' ' '
# Prints default values.
ghostty +show-config --default -- font-family font-sizeIn order to understand how argument parsing and
I'm new to Zig so I also decided to take this feature as a learning opportunity. I hope I didn't miss anything. AI Disclosure: I asked Claude (Sonnet 5, free version) whether it is a good idea to introduce a Why do you want to make this change?The motivation for this change is explained in the original feature request (#2486). This is also useful for me personally. I usually reach for the official website to find documentation for a particular setting, which is not super convenient sometimes. I acknowledge that:
|
!vouch