From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 0ec39d16 for ; Sun, 18 Aug 2019 12:53:04 +0000 (UTC) Received: (qmail 10202 invoked by alias); 17 Aug 2019 17:53:53 -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: 44680 Received: (qmail 13529 invoked by uid 1010); 17 Aug 2019 17:53:53 -0000 X-Qmail-Scanner-Diagnostics: from wout4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25538. spamassassin: 3.4.2. Clear:RC:0(64.147.123.20):SA:0(-2.6/5.0):. Processed in 5.13702 secs); 17 Aug 2019 17:53:53 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type :content-transfer-encoding; s=fm1; bh=onP1UoXnrOWBJxm8xVqlq314ni 5DSTxoyKI6iLoaebE=; b=in6ngmeWT8NOXcDww4djAY4feh0CpdFys/E5iVVdnu 72qH0sEq8aQMq4ihe+Yvho/MhaujfpQgBdAy7NPl/DNW80gb6PLrwUieuwqkVo01 lt2npERajYmnXJTyLDzMTAFEegmgSOwnqK1hlBnbWrvcCRLg95jFQ0h5l9IOJ1Hp dyKaAle+DJO4ozLE3i1uba2xg3P8t6wptG2ZVJH6s/R8WptHbXdd77+7Rkkilp7Q UIm8DDMJi6ZQIRJZi099KEsasktzQ1ABc9jJthxgsBh9FvC8oB0Lz/Rp0aLNmc8G MJEG62dHgoLmssYSXM+P7ax0KFYyNOYC30gfnRcjy6wQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=onP1UoXnrOWBJxm8xVqlq314ni5DSTxoyKI6iLoae bE=; b=ePnGSz91axTkOAc3iLqL6ff/+ZsHG4D/zw++T8KQtqtP5Eb14caHCr2Q+ mQkP9YAff8l45nLjwkzIdvGkl5pdmHDkWasFSCZd8GEoCCyWqKJ4132dazoMLBuB lKF8aE4OXH/NiQJ6iFn94otkUqZU80QEXAw6GV8OukaGn8zDVWRCho5bzOvkyjtC JL70fG6w3qjHakLB/VnrfNdKQw6y464eIRGWPccq+Rft5WxiFZSoH8xTzd68v1+3 iIDAXyXpmRN6tTDSg1KN8Vwk0CVryk2qdvQ53yMI9nl/YqNepdktZAhVcgLOcWjk ADpEJSI4l5XyjAzxon2dzkWdF55mg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudefhedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgfgse htqhertderreejnecuhfhrohhmpedfffgrnhhivghlucfuhhgrhhgrfhdfuceougdrshes uggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvqeenucfrrghrrghmpehmrghilhhfrhhomh epugdrshesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgvnecuvehluhhsthgvrhfuihii vgeptd X-ME-Proxy: X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-869-g2d94aad-fmstable-20190814v1 Mime-Version: 1.0 Message-Id: <0618d7fc-5334-4e51-829a-8684a81744c1@www.fastmail.com> In-Reply-To: References: <1e5195bb-3126-8d0c-8a6a-1f5a5fd2a6c0@yahoo.fr> Date: Sat, 17 Aug 2019 17:53:09 +0000 From: "Daniel Shahaf" To: =?UTF-8?Q?Aur=C3=A9lien?= , dana Cc: zsh-users Subject: Re: help for writing GNU stow completion Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable [moving to -workers@ since it's about an outstanding PR] Aur=C3=A9lien wrote on Sat, 17 Aug 2019 07:51 +00:00: > local stow_dir > local -a stow_pkg_list >=20 > eval set -A stow_dir $1 > [[ -n $stow_dir ]] && stow_pkg_list=3D( $stow_dir/*(-/N:t) ) >=20 > if [[ ${#stow_pkg_list} -gt 0 ]]; then > _values -C "packages from $stow_dir" ${stow_pkg_list[@]} > else > _message "no packages found in $stow_dir" > fi >=20 > and the completion of parameters such as'$HOME' or'~/' works well ! >=20 > I pushed my modifications on github. Thank you for the answers :-) Sorry, but I have to object to the PR as it stands. As I said, using =C2=ABeval $1=C2=BB causes expressions on the command line to be evaluat= ed _when completion is attempted_. To me, that breaks the principle of least surprise, and could lead to unexpected and undesired results. I would strongly prefer another solution, or to be corrected on my interpretation that this violates least surprise. Also, I don't think it's ideal to have =C2=ABfoo --opt=3D$ARG=C2=BB= work and =C2=ABbar --opt=3D$ARG=C2=BB not work. Cheers, Daniel