From 3e08083d493ceff5be1a4ecd0fae6a5b67ef9423 Mon Sep 17 00:00:00 2001 From: 239 <239@users.noreply.github.com> Date: Fri, 24 Jan 2020 18:27:47 +0100 Subject: [PATCH] Add completions for loginctl and resolvectl (#6501) * Add completions for loginctl and resolvectl * Add #6501 * Fix optional arguments * Remove placeholder arguments Fix expected arguments --- CHANGELOG.md | 2 ++ share/completions/loginctl.fish | 26 ++++++++++++++++++++++++++ share/completions/resolvectl.fish | 25 +++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 share/completions/loginctl.fish create mode 100644 share/completions/resolvectl.fish diff --git a/CHANGELOG.md b/CHANGELOG.md index bbdd7c0e5..d6f9a3182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -165,6 +165,7 @@ - `kak` - `keepassxc-cli` (#6505) - `keybase` (#6410) + - `loginctl` (#6501) - `lz4`, `lz4c` and `lz4cat` (#6364) - `mariner` (#5718) - `nethack` (#6240) @@ -173,6 +174,7 @@ - `plutil` (#6301) - `pzstd` (#6364) - `qubes-gpg-client` (#6067) + - `resolvectl` (#6501) - `rg` - `rustup` - `sfdx` (#6149) diff --git a/share/completions/loginctl.fish b/share/completions/loginctl.fish new file mode 100644 index 000000000..a5aec2d68 --- /dev/null +++ b/share/completions/loginctl.fish @@ -0,0 +1,26 @@ +#loginctl (systemd 244) + +#variables +set -l seen __fish_seen_subcommand_from +set -l commands activate attach disable-linger enable-linger flush-devices kill-session kill-user list-seats list-sessions list-users lock-session lock-sessions seat-status session-status show-seat show-session show-user terminate-seat terminate-session terminate-user unlock-session unlock-sessions user-status +set -l output cat export json json-pretty json-seq json-sse short short-full short-iso short-iso-precise short-monotonic short-precise short-unix verbose with-unit + +#commands +complete -c loginctl -x -n "not $seen $commands" -a "$commands" + +#options +complete -c loginctl -f -n "not $seen $commands" -l all -s a -d "Show all properties, including empty ones" +complete -c loginctl -f -n "not $seen $commands" -l full -s l -d "Do not ellipsize output" +complete -c loginctl -f -n "not $seen $commands" -l help -s h -d "Show this help" +complete -c loginctl -x -n "not $seen $commands" -l host -s H -d "Operate on remote host" +complete -c loginctl -x -n "not $seen $commands" -l kill-who -d "Who to send signal to" +complete -c loginctl -x -n "not $seen $commands" -l lines -s n -d "Number of journal entries to show" +complete -c loginctl -x -n "not $seen $commands" -l machine -s M -d "Operate on local container" +complete -c loginctl -f -n "not $seen $commands" -l no-ask-password -d "Don't prompt for password" +complete -c loginctl -f -n "not $seen $commands" -l no-legend -d "Do not show the headers and footers" +complete -c loginctl -f -n "not $seen $commands" -l no-pager -d "Do not pipe output into a pager" +complete -c loginctl -x -n "not $seen $commands" -l output -a "$output" -s o -d "Change journal output mode" +complete -c loginctl -x -n "not $seen $commands" -l property -s p -d "Show only properties by this name" +complete -c loginctl -x -n "not $seen $commands" -l signal -s s -d "Which signal to send" +complete -c loginctl -f -n "not $seen $commands" -l value -d "When showing properties, only print the value" +complete -c loginctl -f -n "not $seen $commands" -l version -d "Show package version" diff --git a/share/completions/resolvectl.fish b/share/completions/resolvectl.fish new file mode 100644 index 000000000..db1b02604 --- /dev/null +++ b/share/completions/resolvectl.fish @@ -0,0 +1,25 @@ +#resolvectl (systemd 244) + +#variables +set -l seen __fish_seen_subcommand_from +set -l commands default-route dns dnsovertls dnssec domain flush-caches llmnr mdns nta openpgp query reset-server-features reset-statistics revert service statistics status tlsa + +#commands +complete -c resolvectl -x -n "not $seen $commands" -a "$commands" + +#options +complete -c resolvectl -x -n "not $seen $commands" -l class -s c -d "Query RR with DNS class" +complete -c resolvectl -x -n "not $seen $commands" -l cname -d "Follow CNAME redirects" +complete -c resolvectl -f -n "not $seen $commands" -l help -s h -d "Show this help" +complete -c resolvectl -x -n "not $seen $commands" -l interface -s i -d "Look on interface" +complete -c resolvectl -x -n "not $seen $commands" -l legend -d "Print headers and additional info" +complete -c resolvectl -f -n "not $seen $commands" -l no-pager -d "Do not pipe output into a pager" +complete -c resolvectl -x -n "not $seen $commands" -l protocol -s p -d "Look via protocol" +complete -c resolvectl -f -n "not $seen $commands" -l raw -d "Dump the answer as binary data" +complete -c resolvectl -x -n "not $seen $commands" -l search -d "Use search domains for single-label names" +complete -c resolvectl -x -n "not $seen $commands" -l service-address -d "Resolve address for services" +complete -c resolvectl -x -n "not $seen $commands" -l service-txt -d "Resolve TXT records for services" +complete -c resolvectl -x -n "not $seen $commands" -l type -s t -d "Query RR with DNS type" +complete -c resolvectl -f -n "not $seen $commands" -l version -d "Show package version" +complete -c resolvectl -f -n "not $seen $commands" -s 4 -d "Resolve IPv4 addresses" +complete -c resolvectl -f -n "not $seen $commands" -s 6 -d "Resolve IPv6 addresses"