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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11711 invoked from network); 6 Apr 2022 15:55:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Apr 2022 15:55:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1649260526; b=fIgtZFx/vg41JiQc8M1+5U/UXIwkRP5WhojLcsk+5K32t9s4cu87K9MKZFiW6IjVRFl51BrFrG UzUQeJgLxASn7vcbdtEk0BK/slHjg72Ier+63wNERnsvXdiyGV5zX4HsXEgXq9u9YUSKTeqjrD /jMkh61wqNxQyPKNfgF2rlZUm/noFWtMmfcTMrWQzgqwZ9kzBs2keb1l2uLiWA+Xs/pTFyajMi 5TMxuUQOK9MuBPVRfoLxGoBYG9r+tGLSOfoyxjOvRb1Ff/gqZxGpTHLURlAnxHnX6PBIRUL99g 5QmLDASAEWitg3NYZyi5YYn6emX/UBspNelwiIhdQM59LQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (vorpal.se) smtp.remote-ip=151.236.221.200; dkim=pass header.d=vorpal.se header.s=2019 header.a=rsa-sha256; dmarc=pass header.from=vorpal.se; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1649260526; bh=FgM4vGd6/+6N+kM7JTkij91I1qydwseRTuH4S53ud0o=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:From:To: MIME-Version:Date:Message-ID:DKIM-Signature:DKIM-Signature; b=PYXlKaKwk0UuubqaqsYkisobYjvWwZU/FFpHo9Y/FlhJ3nL8fJqEelE1k/xNpr5+Avm9vfb4Cl J2OpQQNdpMgk6d7LiMFAw1Kq1+SMt/ksXz7RQLr/yeOyIX41nyy0waF2BCO7+eP9M8dlPFkBlB Wq++RKramc2fGCb+BZBm3UKMYrkrFtJmkM/nP+eB/vkafitas7CVqbD5B6gwFqxKGV5smzEZ8w XVsBl+U974iHOGRwM7WzQ9uGT9NInZ6d6qal6zFWu2DuF3GQ4n/wWViYKoo8EuoBsRWzWSxrXR gYdaGRWL/y3a5t9mdW0w3TFOoFR6LynTlEEh9KbtvDCaRw==; 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-Transfer-Encoding: Content-Type:Subject:From:To:MIME-Version:Date:Message-ID:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=e2dpfRmVtLxJcl/XZC/CS5XSYfbhKBwnmUd4MtyDCHc=; b=C/WmgAJ7e1ARVHTftVUE8BNwSA Kv2iEnBqN0ruW5qvfbtsS0GAMirJkHMDRX+dos0GHlr+k7EK+2wd4wcvCggC39lefjFlE5CFQAeSL 011UOdI15xA+H+VcPjms9Ob/SH98tCF1gPVf/CVe4TpWXa9PjpihFGw3BJY3WIJ5H0ou84h7bbWUm qEQtfSL9OEF4zyQX7ri6drLM3o/UUqOArakVoN5Ak7kl17+NknNc87DZeh4vx542P6kbdMq6lx8L+ VFwUgqNE8VMsPLbYBUlVamAJDT9NsqzQukW59mcW5MXeYABmZh9tdiy/LOFp7XMihRFt+83bkjJ3K JbA4ObxA==; Received: from authenticated user by zero.zsh.org with local id 1nc80D-0007W6-Pf; Wed, 06 Apr 2022 15:55:25 +0000 Authentication-Results: zsh.org; iprev=pass (vorpal.se) smtp.remote-ip=151.236.221.200; dkim=pass header.d=vorpal.se header.s=2019 header.a=rsa-sha256; dmarc=pass header.from=vorpal.se; arc=none Received: from vorpal.se ([151.236.221.200]:53730) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nc7zh-0007AK-F6; Wed, 06 Apr 2022 15:54:53 +0000 Received: by vorpal.se (Postfix) with ESMTPSA id 3138A145B5 for ; Wed, 6 Apr 2022 15:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=vorpal.se; s=2019; t=1649260493; bh=FgM4vGd6/+6N+kM7JTkij91I1qydwseRTuH4S53ud0o=; h=Date:To:From:Subject:From; b=iO+d40eOdyyodmTTw/RnCIQHB7tLerc5oF8qzREixGRPVriSW1kMj2vceLXZ6yLlV ED8mJRxwK62iOQYSxN0jQVRKTwj+CiQfa3p9+hVnmaBho3aHfEhV3BSio9wHAVq0AE YJUjk4jBu7e8AQj+alvXZstfdEuzE03WYJe+ofOnNBkU2Rq+4tNHzuiYZIPrEZWEnb AK+Ppe6zmpRlpLsJBae/xsDT4hamHxz6Vy404KCiIqpMc1cth7w4qnWXrngjXw8PKX PE9V6Jzy5HJ60sWw2MorSkOXeJKS+5r6ftljNetMPs50oLYwsBsGXjJXMAGH+XjXB5 bJVHQ+V+11q6g== Message-ID: <2012c0c3-78e0-7116-0972-6121d3c68203@vorpal.se> Date: Wed, 6 Apr 2022 17:54:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: zsh-workers@zsh.org From: Vorpal Subject: [Bug] Errors in find completion Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Seq: 50003 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: Hi, While implementing completion for an alternative to find I found some bugs in the standard completion file for find (Completion/Unix/_find) that I was using as a reference when doing my implementation. These were things that were incorrect on my Arch Linux system using GNU find. They may or may not be correct for other find implementations. 1. Missing handling of -newerXY: From the man page: --- -newerXY reference Succeeds if timestamp X of the file being considered is newer than timestamp Y of the file reference. The letters X and Y can be any of the following letters: a The access time of the file reference B The birth time of the file reference c The inode status change time of reference m The modification time of the file reference t reference is interpreted directly as a time Some combinations are invalid; for example, it is invalid for X to be t. Some combinations are not implemented on all systems; for example B is not supported on all systems. If an invalid or unsupported combination of XY is specified, a fatal error results. Time specifications are interpreted as for the argument to the -d option of GNU date. If you try to use the birth time of a reference file, and the birth time cannot be determined, a fatal error message results. If you specify a test which refers to the birth time of files being examined, this test will fail for any files where the birth time is unknown. --- I suggest the following addition to find implementations that support this option: '*-newer'{a,B,c,m}{a,B,c,m}'[succeeds if timestamp 1 is newer than timestamp 2 of FILE]:reference file:_files' '*-newer'{a,B,c,m}t'[succeeds if timestamp 1 is newer than timestamp]:timestamp:->times' However! I'm not sure if ->times is correct. The code for that state is a bit cryptic to me, and I don't know if -newerXt supports quite the same things as other time parameters. It is also possible that you want to rewrite this to make the help text more specific to each entry. 2. Incorrect handling of -exec, -execdir, -ok etc: These completion entries are on the following form: '*-exec:program: _command_names -e:*\;::program arguments: _normal' However it is not only ; that will terminate arguments to the program in question. + also works. The difference is that ; will only pass a single argument per invocation while + passes as many as will fit on the command line. Thus a more correct line would be: '*-exec:program: _command_names -e:*(\;|+)::program arguments: _normal' Similar changes must also be made for -execdir, -ok and -okdir Best regards, Arvid Norlander