From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 14D7629A81 for ; Fri, 16 Feb 2024 06:06:23 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1708059983; b=LVnZIe1+n/p6pGP+ip+9jCDuwwSS1CWXCNM4ge4gDHEUxSNDbGWkOYz+5A47W0T0Paqtn28ihF Be6nxAtTuiNX0/iU8WT3JksaFehbacuR0jSQASDIKEeZW4zoLn3EOztVx2/xC64xj6qh8w9ZM2 RDI8LnDpZHhI/D2HYi72Z3ZONF+pz164CxzUsE5nwaFxoqBpc0YVyzueHAMrfZmKGFbSpWmkJd 5I98KPjT6UIred2TvL5BTpKRiiMCTavrV7HKoWGuvy3yd/78JW6ANF15rQV6ypVXkRzX77v57n gFsbOKA56wzTGceYwOnNApse7P+K4TQNJ8S2NKHA7DeqVQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00013-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.13; 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-20210803; t=1708059983; bh=9tphpcdFtoECowOACmzicQiNp/aq/qJpU0GhVDWQewk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:Date:Message-ID:Subject:MIME-Version: Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=YH3NleEHiErMc3NyW8C7vvhxixEgjF2eDKG021MJfiWhBNaYDlsQMU7KapTo3KbiTt9N6QIjAU qCwsaaC+Y7/kfsnb60jJTPVvyP2w1hN9DfnSPZ+PWo8FFwS98CISzXV28c9FeeznPCD1AokZ4W 4++bJ6zdjvUWysRU3XOeu3kEvG4eDWGnNmjZQwgcLV9Qi8RDac8chiDHPUDgpwJ99YFgIDAr/9 FfV09E10NE2bW1MK7jlHI2NhKSJ9CP4RiI7vY+SWWEQuX9ARgjdAzvm1OMIV/OSO8jvsgHXqpJ BjPY3/3J/NJDf4WCTYeKuOt7eDTy2SNOAITmAWyz889AOg==; 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:To:Date:Message-Id: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:In-Reply-To:References; bh=JFwczg0v4/mCS4yi9K7H3lxr3r7KVD689s+LiK1bfs8=; b=XP2oryxZ73MWRysZu2V7YvGsdQ aeh6GBXatKO5fUiPQuwgEvgS47Lxle5ozXDdsqrONGpPSTb81s6DBvjfYkqyxCM1JKgG2YmP8iTaS ZVeO0M1RK7wt6QA7AxYdrmP4HFnhPjFP1OilFsOtoVyUk1AOzJykEE+jGHhyfuTDKuXimXEyeX7hL 1PvofTvsz5i9GaUW/EPRUt9HrWgqTfLBzHVxYht+U5imD/839sLlc1egD3DIar9OA1xzS7DcIQ/P3 FIplIRoBcCx1Qd2CVoMI+9DWerKp3Z25DjcVqZDe1+K/ncqbm3MyMm/XMmGioyf7dp3tCAnBrzNmZ 8VGN52Qw==; Received: by zero.zsh.org with local id 1raqQZ-000KGH-FW; Fri, 16 Feb 2024 05:06:23 +0000 Authentication-Results: zsh.org; iprev=pass (snd00013-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.13; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00013-bg.im.kddi.ne.jp ([27.86.113.13]:46241 helo=dfmta0001.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1raqQG-000JvT-RV; Fri, 16 Feb 2024 05:06:06 +0000 Received: from mail.biglobe.ne.jp by omta0001.biglobe.ne.jp with ESMTP id <20240216050600442.UVNG.128335.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Fri, 16 Feb 2024 14:06:00 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: [PATCH] _diff_options: support macOS Ventura or newer Message-Id: Date: Fri, 16 Feb 2024 14:05:50 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3731.700.6) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 52544 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: macOS was using diff from GNU diffutils, but Apple has replaced it (in macOS Ventura, darwin22) with the one based on the FreeBSD version. It has one Apple-specific option (-A/--algorithm). The option --color is supported by all of gnu/freebsd/darwin. diff --git a/Completion/Unix/Type/_diff_options = b/Completion/Unix/Type/_diff_options index 45b777dfe..03ea1d7fe 100644 --- a/Completion/Unix/Type/_diff_options +++ b/Completion/Unix/Type/_diff_options @@ -25,7 +25,8 @@ _diff_palette() { return ret } =20 -if _pick_variant -r variant -c $cmd gnu=3DGNU unix -v || [[ $OSTYPE =3D = freebsd<12->.* ]]; then +if _pick_variant -r variant -c $cmd gnu=3DGNU unix -v || + [[ $OSTYPE =3D (freebsd<12->|darwin<22->).* ]]; then (( $#words > 2 )) && ign=3D'!' =20 # output formats @@ -73,15 +74,18 @@ if _pick_variant -r variant -c $cmd gnu=3DGNU unix = -v || [[ $OSTYPE =3D freebsd<12-> "($ofwl $ouc $oss)--unchanged-line-format=3D[set unchanged line = format]:unchanged line format" '(--to-file)--from-file=3D[compare specified file to all = operands]:from file:_files' '(--from-file)--to-file=3D[compare all operands to specified = file]:to file:_files' - '--color=3D-[use colors in output]::when [auto]:(never always = auto)' '--palette=3D[specify colors to use]:color:_diff_palette' "${ign}(1 2)-v[display version information]" ) else args+=3D( '!--speed-large-files' ) + if [[ $OSTYPE =3D darwin<22->.* ]]; then + args+=3D( '(-A --algorithm)'{-A+,--algorithm=3D}'[specify the = algorithm to use]:algorithm:(myers patience stone)' ) + fi fi =20 _arguments -s $args \ + '--color=3D-[use colors in output]::when [auto]:(never always = auto)' \ '(-i --ignore-case)'{-i,--ignore-case}'[case insensitive]' \ '--ignore-file-name-case[ignore case when comparing file names]' \ '!(--ignore-file-name-case)--no-ignore-file-name-case' \