From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4743 invoked from network); 31 Dec 2022 04:54:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Dec 2022 04:54:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1672462489; b=Nt3GOiVmHBOu77GpeEqdxtQAC4cSiZMd0f6EH4qcT+o/oAeZzNmBODwd7iujrWEst7+7Q+rGJ1 MdG9tHIrILJKTismdKWPoDDILoPE1wHAzTIlDYTw8JaLev6pFFLkk+YBWvrJLpUaZoo4GMrUcj OAzdi7++LqVt1ENVJ+c4GuJ/wXKa6DdqsCaUq/K50iVpqQQGkiFdpWzj/GnOfWIwKlrB/Se5RI ybhgaTFbSjV8Po7lrpPOu8MHLrN8LBne++dmHKG7l/KMcs//LDOwVgC437tWur3j49tIuXZ6o0 sdMOQogqUA+NUa44/AwKJ1+kuBo+rhqwhMfaKQhrmCoe4Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f45.google.com) smtp.remote-ip=209.85.218.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1672462489; bh=2OnODESWQGKQYmIOTUSwD/tS+gEXVrZi4GWH8WHUjIY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=CQ7h2d7JWa3IUIUjw7NDaIrY08uvmK+iw5+oFo3g/aQc1++0z8TseaPGe/ak50PJwMlDdce2OV vu3bgOJtNYgnvirj/pmVltquuTNbUo+0AlaZy82NWTFTAYAH9UpY/1xmk2Qf7UACx4iRCDZP7n i3Yedth47V+3Sk/EjqyY2P+efbui8e4epNGfTOhSrC8ySRU6ygmbCMtYZYEh2xekTWc6NvZVkj 0VfA9EGZWVx1WeybXOG/pmRU/3vmmlnc17+AjvGYAwDJJn0Co14d9ouqLvBjgAoRQ56k9cPyMh a1XiRN5leE4N4vtW6VYixhBj+jMl6+UgQWfV4XNo8l8WdA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=/1JftKjTUrYF6pllFKSEo4D29myPVosvY4xRLkE4WOA=; b=Tlj5bIvjNRWeIcrJwbuenhjDNR iM8a5m+UrF7I3CqOxchDWFZPn7VQoQpu1IcBBX+1dcWT5aY1QWIR/LZPG8s8AVsNwtjRMqHAuOvxG e7vUedQ/XKxNcSqTTle5XR66AMK2jlN4Tpgt0t85mcc+gp+19kpV159macz8OlnNGLWk5hRRPbsxm FGtkfhz8gfw8FvyaDafAVqbCgwBwTNbjYaeRNjigc2xQlNkJ9pVLVBw3Er7nGto7VJLQZsH4DxEel Rij3o4Ip+BzU5b2AaQhWNWNYY53V0RzOjrYJbhtmgxONi8Xg+DuAvJl/YTPXHOdRIEIm1gzDkupWE gAkiQShg==; Received: by zero.zsh.org with local id 1pBTtP-000LmY-ER; Sat, 31 Dec 2022 04:54:47 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f45.google.com) smtp.remote-ip=209.85.218.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f45.google.com ([209.85.218.45]:44945) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pBTsq-000LR3-0P; Sat, 31 Dec 2022 04:54:13 +0000 Received: by mail-ej1-f45.google.com with SMTP id x22so55338314ejs.11 for ; Fri, 30 Dec 2022 20:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/1JftKjTUrYF6pllFKSEo4D29myPVosvY4xRLkE4WOA=; b=vMSQpIU01rfw7XBzIVoYpk0bsR5bv8VXrNJQKko7S6hl8LbtiwZDPQDj8+G/+q/ave Tpb6B+0ZOXb6L08OlkCbWcMFcz/GLjRSmgEtN5AN0mlpIEeM+bcTRp9yPwg1H0FpJdDu zyPaxK2Zy58ogngUXGC8U5qXYLKcre3oUZI3Q5z9eF7FXyx74QQSfXgITMA2XJxvNwzS 0GTCXOs5a2Kkg9vkEjVW/PeiJD8qVJ9BxC55FiGqvFjVA+yhsuQ5rc4TZIUX4u1HBfzX Kk7OG3jFUaZVCkileHIR8PKFaxlndcsI2VsWsssG+JXUgU2sXWx5KG/uFoTW1bLe1xaZ GfgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/1JftKjTUrYF6pllFKSEo4D29myPVosvY4xRLkE4WOA=; b=Js61xTliNGdLCFIT16dT9LLrUWx++6BehMQO1VuPysXMjfxmUNJCb00CitQpeyh3Fe 1zmQFVR89u7ksiCYuLq+eKawUyoDIeBzVkUZEWjYPPlnWyyjBleWZ62iAvPPgy4G1MDG t6I5NPPskYBe8sBzR5QdI1bSxi1100UCWs3RtmOnVqmVd+cn/jfLKOLIM3wDe18HykzG k9TArSBnOIJOhoNgdF31J9C8qMm/idcZcEy3nw/vSoY1AIAaW0povuZ0tcEuS3ozTv7T VJzURxc2EKuSrYtE2eWW6mK4ScQIzpRohdVWFWM4bcw/Sf0YA8VPL376ETnRAO847+Fs H2UA== X-Gm-Message-State: AFqh2krV0WPaM/66rk2FUY5XecclFiTtAT5BoM0WixWnZ5LYGBp4I4oJ lbW6vAP9J2yyk+tnoRoHRAowheU3IAm67GVs6OviZw== X-Google-Smtp-Source: AMrXdXsaQ73Y3sT3c6sREFxV6N+weGbXAhXuN/PDK+kjdzYhan9HKDJVz0pZ2IbH7FUxDUcbrnJHd7GOn+Hp/xhtHXI= X-Received: by 2002:a17:906:8693:b0:7c0:d4c7:c00d with SMTP id g19-20020a170906869300b007c0d4c7c00dmr3459455ejx.345.1672462451397; Fri, 30 Dec 2022 20:54:11 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 30 Dec 2022 20:54:00 -0800 Message-ID: Subject: Re: _arguments trips on dog To: Mikael Magnusson Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 51265 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Mon, Dec 26, 2022 at 1:08 AM Mikael Magnusson wrote: > > _arguments:comparguments:327: invalid option definition: > -w[cols][print first 'cols' characters of each line (default=80)] Trying to track this down has caused me to realize that _call_program ... 2>&1 trips badly on _complete_debug. The trace output ends up captured despite efforts within _call_program to fix the redirection. I would think the right thing to do is pass a flag to _call_program indicating that the stderr of the called command is wanted, and let _call_program do the 2>&1 itself. Anyway, that's for another thread. > which is due to this line in dog --help output: > -w[cols] print first 'cols' characters of each line (default=80) This does *something* but doesn't really get the details right, and I'm not sure it should be generalized here. diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index 5ff34ff47..c803d1133 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -134,6 +134,12 @@ if (( long )); then # maybe needs to be more general if [[ $start = (#b)--\[(*)\](*) ]]; then tmp+=("--${match[1]}${match[2]}" "--${match[2]}") + elif [[ $start = (#b)-(-#*)(\[*\]) ]]; then + # variant syntax seen in dog: + # -w[cols] print first 'cols' characters of each line (default=80) + # means a number follows -w with no space or equals + rest="\\-${match[1]}${(b)match[2]} ${rest##[[:space:]]#}" + tmp+=("-${match[1]}") else tmp+=($start) fi Maybe this gives someone else a better hint.