From 406023ed33a50bc4205df4bb3f69e7bf2245ca52 Mon Sep 17 00:00:00 2001 From: Benjamin VAUDOUR <60374-benjamin.vaudour@users.noreply.framagit.org> Date: Sat, 13 Aug 2022 09:19:43 +0200 Subject: [PATCH] Add doas completion (2) (missing file in previous commit) --- completion/doas.elv | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 completion/doas.elv diff --git a/completion/doas.elv b/completion/doas.elv new file mode 100644 index 0000000..74f7e6e --- /dev/null +++ b/completion/doas.elv @@ -0,0 +1,10 @@ +fn complete {|@argv| + if (and (> (count $argv) 2) (has-key $edit:completion:arg-completer $argv[1])) { + $edit:completion:arg-completer[$argv[1]] (all $argv[1:]) + } else { + edit:complete-sudo $@argv + } +} + +set edit:completion:arg-completer[doas] = $edit:complete-sudo~ +#edit:completion:arg-completer[doas] = $-complete~