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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27416 invoked from network); 19 Mar 2021 03:52:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Mar 2021 03:52:13 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1616125933; b=tG8pRiATyIRz63nHxc5nsDnX5u8R4buuF2xnsjjqw6yYG/Iou/jVcWA9HKK7AHsJZBLhBYZf5Y hy8ecxsQGhxg2VCpDaMGxTPrCgw2uYF+cb9MmMPiDKNbbN10zkkRfqMkmpL7EQZ9Y58JtT520E 7NvhpmxclOLRpOz/cEcj7VlfMIbzjtf9+9HTSrlrGxU8vK48GNmk0VLQZl3Hcq49xdoyF3w3cI dVS3kp5/InVEmmj9S+lFHH9ckwgxL02DiH6xYrz0WEx+hJhhHa0Ztyv8mEA0arLmND7DA1f9r9 62D9YVIGzQ/JRRLb+IOpZm3G6Rzef3tWJhRDu7L07uIkUQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01007-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.23; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1616125933; bh=K+r0mVrac29iLi0xm8L91pWoAAmubSa1VE5EL1GkLzs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=i4rxVCeWLgC+uwPyjz065Dv3RDERPFr8ZZwJGXGGy76d3ySSvT4Q5bdoI8swCwVZ9IagWU4Awr V6LrzELcB/Q36kB/1whl0fKkCCH6pb+IUmZo4jhLcj06qztEoCw45/g7FeQXfXCXmYBcdYaSw+ qw2J6yDkfyfmBEIoMcJ09NbSYHPhltfK99m4zZTnSgB5iG6C2fqG5vCt0PBjSmIuCkS2KozIf9 5iSXMotN1136yQFYql7Luhq+8+ZdSgIwC6AXrYtkSOrjdpJ31BLWBt5d0WKZH8jumpT3UjT5AJ Ta2KshgDc+4jx87/ZrkdXKjQPPEpxOP0EPc8uhIEIiYvqg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=K+r0mVrac29iLi0xm8L91pWoAAmubSa1VE5EL1GkLzs=; b=BYHt5io//jMPF3nik22Poz+X45 RC0JiM3jkVhrqkNXp41WL2lTnH5yPTp+GDwHZBVI6VsBmynAMiIzCe96uB+wMx6LqtgoaQUQi7rKN +c8LWn8oCHYR6EEP09sxwswGGSn9F6Am9B163zlfd45ruo99LCYnMp0lgJpPyS77EkuLh8oyZL05c 0H0awEafQezdP5vqCQ/VBVd7321kCXDx1Jm29u4XPCVQcQNkEcJBJldzTKMX4oMONiESe0e/05xcp n5AmFqzvG7q4lbWRnUfGCjXVVepbSZm4Ctj1o5qGJzm0eTxX9mmDJTeK0wRlK4q9vZ6ajMABWJ592 bArjuGhA==; Received: from authenticated user by zero.zsh.org with local id 1lN6BI-0005ga-Pe; Fri, 19 Mar 2021 03:52:12 +0000 Authentication-Results: zsh.org; iprev=pass (snd01007-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.23; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01007-bg.im.kddi.ne.jp ([27.86.113.23]:11137 helo=omta1013.biglobe.ne.jp) by zero.zsh.org with esmtp id 1lN6Av-0005Xc-Le; Fri, 19 Mar 2021 03:51:51 +0000 Received: from mail.biglobe.ne.jp by omta1013.biglobe.ne.jp with ESMTP id <20210319035145826.UOET.122449.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Fri, 19 Mar 2021 12:51:45 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: Improvements to the gcc completion script Date: Fri, 19 Mar 2021 12:51:45 +0900 References: To: zsh-workers@zsh.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3445.104.17) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 48187 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: Archived-At: Thank you for lots of improvements! Please consider the following points (some of them already existed before your improvements): In args for clang (line 509 and below), there are several duplicated = options such as -fshow-source-location, -lazy_framework, etc. Some options (such as -fauto-profile) can take optional argument. For these, it would be better to use --fauto-profile=3D-::message:action instead of duplicating it with and without arg. > 2021/03/12 13:07, Jacob Gelbman wrote: > The current completion for the argument of -l wouldn't work if the = $LD_LIBRARY_PATH had more than one path in it, because paths are = separated by : traditionally in that variable, so I made sure completion = works if there are :'s in it. Also I added = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib to the = default path since that's the one macOS uses. I think LD_LIBRARY_PATH is not used at link time (it is used only at run = time), and we can ignore it when completing libraries ( -l ). Is this = correct? TODO (you can left this for someone else): Add directories specified by -L/path/to/dir on the command line to = library_path. > Added the -framework option, and completed the names of frameworks it = can take. frameworks are macOS's style of library. -F, -iframework and -iframeworkwithsysroot can be specified multiple = times. Please use '*-F' etc for optspec. For -iframework you can use '_files -/' as action (like -F). # -iframeworkwithsysroot is meaningful only with -isysroot, and, = ideally, # '-iframeworkwithsysroot ' should offer directory relative to = isysroot. # But I think such an elaboration would not be necessary. -framework, -lazy_framework and -weak_framework can also be specified = multiple times. The latter two can use '->framework' as action (as -framework). It would be better to include Framework-related stuff only if '$OSTYPE =3D= darwin*'. I don't have any detailed knowledge of how Apple's command line tools = work, but probably it would better to use the output of 'xcrun = --show-sdk-path' instead of=20 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk. TODO: Add directory specified by -F/path/to/dir to framework_path > I changed the input file type because sometimes it's useful to include = library files on the command line, and these have extensions .so*, .a, = .dylib, or even with no extension like in mac's frameworks. I thought it = better if it just completed all files and not just .c, .cpp, .m, etc. I believe most users will not like this. Instead, please use something = like=20 zstyle ':completion:*:*:gcc:argument-rest:*' file-patterns '*' for your personal customization. > I removed the matchspec "r:|[_-]=3D*" from the _arguments call because = there were certain options where I would try to complete them, and they = positioned the cursor elsewhere unexpectedly. for example, I wrote = "clang --opt" and after it completed up until --optimiz, it = positioned me on the second - when I expected to be at the end of the = fully completed option, --optimize=3D. also it didn't fully complete, it = left it at --optimiz. I can't reproduce your problem. The matcher 'r:|[_-]=3D*' is quite useful and better not to be removed = since it allows gcc -fd-s-l to be completed to gcc -fdiagnostics-show-location=3D > I added a completion for arguments to -Werror=3D ... (snip) Thanks. I think -Werror can also be specified multiple times = ('*-Werror=3D-'). ---- Jun=