|
| 1 | +# Nu shell completions for dog |
| 2 | + |
| 3 | +# Query options completers |
| 4 | +def "nu-complete dog types" [] { |
| 5 | + [ |
| 6 | + "A" |
| 7 | + "AAAA" |
| 8 | + "ANAME" |
| 9 | + "ANY" |
| 10 | + "AXFR" |
| 11 | + "CAA" |
| 12 | + "CNAME" |
| 13 | + "DNSKEY" |
| 14 | + "DS" |
| 15 | + "HINFO" |
| 16 | + "HTTPS" |
| 17 | + "IXFR" |
| 18 | + "MX" |
| 19 | + "NAPTR" |
| 20 | + "NS" |
| 21 | + "NULL" |
| 22 | + "OPENPGPKEY" |
| 23 | + "OPT" |
| 24 | + "PTR" |
| 25 | + "SOA" |
| 26 | + "SRV" |
| 27 | + "SSHFP" |
| 28 | + "SVCB" |
| 29 | + "TLSA" |
| 30 | + "TXT" |
| 31 | + "RRSIG" |
| 32 | + "NSEC" |
| 33 | + "NSEC3" |
| 34 | + "NSEC3PARAM" |
| 35 | + "TSIG" |
| 36 | + ] | str upcase |
| 37 | +} |
| 38 | + |
| 39 | +def "nu-complete dog classes" [] { |
| 40 | + [ |
| 41 | + "IN" |
| 42 | + "CH" |
| 43 | + "HS" |
| 44 | + ] | str upcase |
| 45 | +} |
| 46 | + |
| 47 | +def "nu-complete dog edns" [] { |
| 48 | + [ |
| 49 | + "disable" |
| 50 | + "hide" |
| 51 | + "show" |
| 52 | + ] |
| 53 | +} |
| 54 | + |
| 55 | +def "nu-complete dog tweaks" [] { |
| 56 | + [ |
| 57 | + "aa" |
| 58 | + "ad" |
| 59 | + "bufsize=" |
| 60 | + "cd" |
| 61 | + ] |
| 62 | +} |
| 63 | + |
| 64 | +def "nu-complete dog colors" [] { |
| 65 | + [ |
| 66 | + "always" |
| 67 | + "automatic" |
| 68 | + "never" |
| 69 | + ] |
| 70 | +} |
| 71 | + |
| 72 | +# Define the external command with completions |
| 73 | +extern "dog" [ |
| 74 | + --query(-q): string # Host name or domain name to query |
| 75 | + --type(-t): string@"nu-complete dog types" # Type of the DNS record being queried |
| 76 | + --nameserver(-n): string # Address of the nameserver to send packets to |
| 77 | + --class: string@"nu-complete dog classes" # Network class of the DNS record being queried |
| 78 | + --edns: string@"nu-complete dog edns" # Whether to OPT in to EDNS |
| 79 | + --txid: string # Set the transaction ID to a specific value |
| 80 | + -Z: string@"nu-complete dog tweaks" # Set uncommon protocol tweaks |
| 81 | + --color: string@"nu-complete dog colors" # When to use terminal colors |
| 82 | + --colour: string@"nu-complete dog colors" # When to use terminal colours |
| 83 | + --udp(-U) # Use the DNS protocol over UDP |
| 84 | + --tcp(-T) # Use the DNS protocol over TCP |
| 85 | + --tls(-S) # Use the DNS-over-TLS protocol |
| 86 | + --https(-H) # Use the DNS-over-HTTPS protocol |
| 87 | + --short(-1) # Short mode: display nothing but the first result |
| 88 | + --json(-J) # Display the output as JSON |
| 89 | + --seconds # Do not format durations, display them as seconds |
| 90 | + --version(-V) # Print version information |
| 91 | + --help(-?) # Print list of command-line options |
| 92 | + --list(-l) # List known DNS record types |
| 93 | + --verbose(-v) # Print verbose information |
| 94 | + ...domain: string # The domain to query |
| 95 | +] |
0 commit comments