From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15899 invoked by alias); 14 Jul 2018 11:36:57 -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: 43170 Received: (qmail 814 invoked by uid 1010); 14 Jul 2018 11:36:57 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f66.google.com 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(74.125.82.66):SA:0(-1.9/5.0):. Processed in 0.779036 secs); 14 Jul 2018 11:36:57 -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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: doron.behar@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zjgELjK7dj3ODBYL/PgkwraILcAMfS4hzedUkjbXlTA=; b=tv7YP+sI7gjR6Pk8OzxkleRVzH2mdX/zmYV5iDuL2Od1efzdHt5RqbWGHVCJjetvRu Sn8xA0382bqeum0F+FySVfLGzzam14EH9/TDZkvAl8GDOa2dQPVbANcpBoZJlwv7th3u hnmIqnMiQFMi3RuE5ONSCOcC2i9f0MHTlDu8gs3Xo7IDqHhIlalCaOmBCV/qxvPJ7pDy 3P7AR/e4VeOtiWs430HckyefE6Qnpy+zOl/UG7Qtpqw8uNtNUM1I0On7FaWoGE/E904O GrGt0m/GosnfzoalsyZG9839pOHkXGKtR7HF1Z2nkwf/LZCUfYIpgmaE8/vn0bdPiBwT z/7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=zjgELjK7dj3ODBYL/PgkwraILcAMfS4hzedUkjbXlTA=; b=aHTaKMLLYpz87/G/Tco0Xn1HP1++xYFVPpPZ8U7kLDAeUWPMqY+kPspsErPcqH7j5F nU+GwPDNN0cQOJUCBxS3VZYNXMyGpxUz5UUjP/x88dO4//1NKJwCuzIoIuw57IrHWP5A ULRYgVv8vJyOvaMKANQcnqBcW0JhPH5JDmL+LoO1GcH3CIUcSkAZ6D8Ueyc2iL9ZC0qe /42apQyE/HKfWnA3l5cfJEyQtWjNfIWBc3e1v8WCrS15ulc3C4cuVtW43PUEjNfCdPMR hbmbVmcIaEkhuU1psg1S7NqDG7NZUtLaWQKk/wJ4qV+ALCvSDQKO7u/fOStTtIO69Vzo GZYA== X-Gm-Message-State: AOUpUlHqgyU9UFBoWHUTlBiZ0uUMmzN4Zxb/o96E2WxIQUPs4TcQMsQ3 0ZJJ5xCNyTE5UFwWuzJ9ZfL9qVNL X-Google-Smtp-Source: AAOMgpfrOo+8GpLMLzgVCPRD6Idt5akJwhqnaGoFt0H8nHsJ5pspLv7iEdUhCs++p5Jjo1KDuFZHqQ== X-Received: by 2002:a1c:e54:: with SMTP id 81-v6mr5003657wmo.84.1531511600762; Fri, 13 Jul 2018 12:53:20 -0700 (PDT) Date: Fri, 13 Jul 2018 22:53:09 +0300 From: Doron Behar To: zsh-workers@zsh.org, dana@dana.is Subject: Re: [PATCH] Add completion for zathura. Message-ID: <20180713195309.wvebah6b4j4jb26z@NUC.doronbehar.com> Mail-Followup-To: zsh-workers@zsh.org, dana@dana.is References: <20180613163152.28843-1-doron.behar@gmail.com> <20180701171158.6uzs27ooafm4pk42@NUC.doronbehar.com> <20180713122909.o5rpg6ocoigx6sv3@NUC.doronbehar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180622 On Fri, Jul 13, 2018 at 11:55:09AM -0500, dana wrote: > On 13 Jul 2018, at 07:29, Doron Behar wrote: > >How quoting `opt_args` and use `(Q)` will be better as for this issue? > > The values in opt_args are quoted exactly as they were received from the command > line. So if the user does `zathura -p '/path/to/some/'"file"`, you will receive > it exactly like that, with both sets of quotes, in opt_args. Therefore, if you > don't use (Q), your checks may fail when they would otherwise succeed, since > they're trying to match a path containing literal quotes. > > There's probably an even better way to do this, but this is what comes to mind: > > for plugins_dir in \ > ${(Qv)opt_args[(i)-p|--plugins-dir]}(#qN) \ > {/usr/local,/usr,}/lib/zathura(#qN) > do > plugins_files=( $plugins_dir/*.so ) > (( $#plugins_files )) && break > done Works like a charm. I'll be sending a complete revised patch shortly.