chiark / gitweb /
zsh_completion: Speed up noncached perf of _journalctl
authorWilliam Giokas <1007380@gmail.com>
Fri, 2 Aug 2013 02:35:16 +0000 (21:35 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 2 Aug 2013 14:44:24 +0000 (10:44 -0400)
Splitting things unnecessarily at newlines causes tab completion to take
an extremely long time. Also add a note saying that caching is not good
for journalctl's completion.

shell-completion/zsh/_journalctl

index 4409fd7..61983d5 100644 (file)
@@ -24,7 +24,8 @@ _list_fields() {
 
 _journal_none() {
     local -a _commands _files
-    _commands=( ${(f)"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} )
+    # Setting use-cache will slow this down considerably
+    _commands=( ${"$(_call_program commands "$service" -F _EXE 2>/dev/null)"} )
     _alternative : \
         'files:/dev files:_files -W /dev -P /dev/' \
         "commands:commands:($_commands[@])" \