ISC bind-utils dig completion with hints helper option file for "@"#1625
Open
ISC bind-utils dig completion with hints helper option file for "@"#1625
Conversation
Signed-off-by: Mauricio Vergara Ereche <mave@cero32.cl>
…ading Signed-off-by: Mauricio Vergara Ereche <mave@cero32.cl>
Signed-off-by: Mauricio Vergara Ereche <mave@cero32.cl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adding dedicated completion for ISC BIND dig (
completions-core/dig.bash), registers it in the build, adds tests, and removesdigfrom the generic_comp_complete_known_hostsregistration inbash_completionso installeddig.bashcan take effect instead of always completing only hostnames.Behavior (
completions-core/dig.bash)+queryoptions and@server-c/-tflags) completion stops offering more classes or types. Meanwhile+options can be multiple.ANY: classified as RRTYPE first (matchesdig <NAME> ANY);*.bind-style names when class isCHand type isTXT.-q, dotted tokens, or non–class/type-prefix tokens use_comp_compgen_known_hostswhere applicable.compopt +o bashdefault +o defaultto avoid broad default hostname fallback on emptyCOMPREPLY.@server:~/.ssh/known_hosts, orBASH_COMPLETION_CMD_DIG_NS_HINTS_FILEfor suffix-based hints (longest pattern wins,*defaults; trailing dots on name/pattern normalized). Format documented in commentsExample of
$BASH_COMPLETION_CMD_DIG_NS_HINTS_FILE:Note on removing
digfrom./bash_completionGiven that
digwas registered with_comp_complete_known_hosts, that generic hostname completer took precedence over the lazy-loadedcompletions-core/dig.bash, so dedicated completion for class, RR type, @server, and + options never ran.The other option to avoid this case is to add into
.bashrcor.bash_profilethe load of the dig completion after loading bash-completion with_comp_load(example in macos withbrewinstallation):Files
completions-core/dig.bashcompletions-core/Makefile.amdig.bashbash_completiondigwith_comp_complete_known_hoststest/t/test_dig.pytest/t/Makefile.amtest_dig.pyTesting
pytest test/t/test_dig.py(cases withrequire_cmd=Trueneed dig on PATH).