From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8582 invoked by alias); 8 Jun 2018 16:29:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42960 Received: (qmail 2865 invoked by uid 1010); 8 Jun 2018 16:29:10 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(205.235.26.22):SA:0(-1.4/5.0):. Processed in 0.416098 secs); 08 Jun 2018 16:29:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=YYjJ=I2=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1528475330; bh=rEHttjNu4LAEJNJNeinOkI0U4RsYdPlfP+cUvBPgIvw=; h=From:References:To:Subject:Date:From:Subject; b=e0BsLDtmFsspwKDxlzKWuqLXHYp1mpL0wwpafT6YL3mvCmUzumCsEBrJJLqgdNVSvB53LjOhTKYN20AF8HtBXwtMcfcLZ3oQCLXpxnweY7c4LygeE7bmFCVnR55LtEvflagvEAw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kuWyxt9pyKJqxjXmwOkObUiEWO1_qLDo1AFjBbmjS5g6m z7nMy0XLtggeWEXrcHxyLP42FSgho1K_lk3bTTrHkteCMOS9J17TzCH6k2HC1_rXkH47mbQFAmfF pu_KCgCwtTc4fComj.EBOFA-- cc: zsh-workers@zsh.org In-reply-to: <20180608155331.2891-2-doron.behar@gmail.com> From: Oliver Kiddle References: <20180608155331.2891-1-doron.behar@gmail.com> <20180608155331.2891-2-doron.behar@gmail.com> To: doron.behar@gmail.com Subject: Re: [PATCH 1/1] Add completion for zathura. MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24169.1528475324.1@thecus> Date: Fri, 08 Jun 2018 18:28:44 +0200 Message-ID: <24170.1528475324@thecus> doron.behar@gmail.com wrote: Thanks for this, I have some comments: > +(( $+functions[_zathura_files] )) || > +_zathura_files(){ > + for plugins_dir in "${opt_args[-p]}" "${opt_args[--plugins-dir]}" "/usr/lib/zathura"; do For my installation of zathura, this finds no plugins. Perhaps they are compiled in. It handles at least PDF and PostScript. > + local files_regex="*.{${supported_filetypes[1]}," > + for (( i = 2 ; i < ${#supported_filetypes[*]}; i ++)); do > + files_regex="${files_regex}""${supported_filetypes[$i]}""," > + done > + files_regex="${files_regex}""${supported_filetypes[-1]}""}" > + _files -g "${files_regex}" I think this can be simplified to avoid the loop when constructing the file glob: "*.(${(j.|.)supported_filetypes})(-.)" > + > +_arguments \ > + {-e,--reparent=}'[Reparents to window specified by xid]:XID: ' \ As with your previous function, please stick to conventions on case for descriptions: don't use uppercase for the first word. And don't put the headings (like XID, PATH, NUMBER, PASSWORD) in block capitals. X IDs are completed by _x_window. > + {-c,--config-dir=}'[Path to the config directory]:PATH:{_files -/}' \ > + {-d,--data-dir=}'[Path to the data directory]:PATH:{_files -/}' \ > + {-p,--plugins-dir=}'[Path to the directory containing plugins]:PATH:{_files -/}' \ > + {-w,--password=}"[The document's password]:PASSWORD: " \ > + {-P,--page=}'[Opens the document at the given page number]:NUMBER: ' \ > + {-l,--log-level=}'[Set log level]:LEVEL:(debug, info, warning, error)' \ Remove the commas in the list. It is a space separated list when you specify multiple options like that. > + {-x,--synctex-editor-command=}'[Set the synctex editor command]:COMMAND:_command' \ _command is the completer for the command reserved word so is not applicable here. You probably want either _command_names -e or _cmdstring. Oliver