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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7360 invoked from network); 7 Feb 2021 01:09:06 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Feb 2021 01:09:06 -0000 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:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=X3p6zGYktK/+aXSCiNYbf9U23kpuBXo9WidGryn8r9w=; b=pfEqqGGprAuc+pNQPm2b1DqfWM SIFi7KnKgRSnjNkZYGGW7y+TCQ/qapeYD9QgL/pSJLjPk1T83jkSnboUOySuP1Wj66X8ipDjfex92 BOPwUcW4gjNcxKFzxKHi6GN/oaaXqZZAJ1U0RaEda72W+aERjHRIgOXW0Sqerxr+rG9fBc1Xhzcqr 5yh3GVROhU4nV2TCQx+KWXbpNhkFLvenqUOw1fztowUK+cpeWgNhOZuroQi7cSVYXonWzu9SgQ6w+ 5eJ+MjmEXWkFp2l9neQLouyXnHWwwW4azmxfyv9Awl5JYjxHv7EY2prtRdMo6SMVJUxKm7S4cEOxW j8mtjQeg==; Received: from authenticated user by zero.zsh.org with local id 1l8YZR-0006S6-6V; Sun, 07 Feb 2021 01:09:01 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1l8YZA-0006Jh-L6; Sun, 07 Feb 2021 01:08:44 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.93.0.4) (envelope-from ) id 1l8YZA-00071r-0E for zsh-workers@zsh.org; Sun, 07 Feb 2021 02:08:44 +0100 From: Oliver Kiddle To: Zsh workers Subject: PATCH: update option completion for newer FreeBSD MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27021.1612660123.1@hydra> Date: Sun, 07 Feb 2021 02:08:44 +0100 Message-ID: <27022-1612660124.003945@J3NR.uMY3.C0wZ> X-Seq: 47930 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: I'm rather behind with the usual process where I diff --help etc output to identify new and changed options relative to the completion functions. I'll try to catch up a bit. If anyone would like to help, that'd be much appreciated, I can point you to the relevant scripts on github. As Daniel pointed out, the big patches are not easy to review. I regularly manage to slip silly mistakes in, especially as the patches have often sat around in my own repository for months first so I'll send these out in smaller bites. My apologies if that means more noise on the list. To start with this patch covers FreeBSD (minus zfs) up to 12.2 (though I think these changes all appeared earlier) - diff, uniq and freebsd-update. Oliver diff --git a/Completion/BSD/Command/_freebsd-update b/Completion/BSD/Command/_freebsd-update index d42457272..7dd907298 100644 --- a/Completion/BSD/Command/_freebsd-update +++ b/Completion/BSD/Command/_freebsd-update @@ -5,9 +5,11 @@ flags=( '(cron)fetch[fetch a compressed snapshot or update existing one]' '(fetch)cron[sleep rand(3600) seconds, and then fetch updates]' '(install rollback)upgrade[fetch files necessary for upgrading to a new release]' + 'updatesready[check if there are fetched updates ready to install]' '(upgrade rollback)install[install the most recently fetched updates or upgrade]' '(upgrade install)rollback[uninstall the most recently installed updates]' 'IDS[compare the system against an index of "known good" files]' + 'showconfig[show configuration options after parsing conffile and command line options]' ) _arguments \ diff --git a/Completion/Unix/Command/_uniq b/Completion/Unix/Command/_uniq index 97f73b3ac..e123a94cd 100644 --- a/Completion/Unix/Command/_uniq +++ b/Completion/Unix/Command/_uniq @@ -23,8 +23,9 @@ args=( if ! _pick_variant gnu=Free\ Soft unix --version; then local optchars="cdufs" if [[ "$OSTYPE" == (darwin|dragonfly|freebsd|openbsd)* ]]; then - optchars="${optchars}i" + optchars+=i fi + [[ $OSTYPE = freebsd* ]] && optchars+=D args=( ${(M)args:#(|\*)(|\(*\))-[$optchars]*} ) fi diff --git a/Completion/Unix/Type/_diff_options b/Completion/Unix/Type/_diff_options index 440913dff..dfa9889f2 100644 --- a/Completion/Unix/Type/_diff_options +++ b/Completion/Unix/Type/_diff_options @@ -70,9 +70,7 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> '(-E --ignore-tab-expansion)'{-E,--ignore-tab-expansion}'[ignore changes due to tab expansion]' '(-Z --ignore-trailing-space)'{-Z,--ignore-trailing-space}'[ignore white space at line end]' "($ofwuc $oss -F --show-function-line)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' - "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' "($ofwy $ouc)--left-column[output only left column of common lines]" - "($ofwy $ouc)--suppress-common-lines[do not output common lines]" "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format" "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format" "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" @@ -80,8 +78,6 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> '(--from-file)--to-file=[compare all operands to specified file]:to file:_files' \ '--color=-[use colors in output]::when [auto]:(never always auto)' '--palette=[specify colors to use]:color:_diff_palette' - "($of $ouc)--side-by-side[output in two columns]" - "($of $ouc)-y[output in two columns]" ) else args+=( '!--speed-large-files' ) @@ -128,6 +124,9 @@ if _pick_variant -r variant -c $cmd gnu=GNU unix -v || [[ $OSTYPE = freebsd<12-> '(-S --starting-file)'{-S+,--starting-file=}'[set first file in comparison]:start with file:_files' \ '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines' \ '(-d --minimal)'{-d,--minimal}'[try to find a smaller set of changes]' \ + "($of $ouc)"{-y,--side-by-side}'[output in two columns]' \ + "($ofwy $ouc)--suppress-common-lines[don't output common lines]" \ + "($ofwy $ouc --width -W)"{--width=,-W+}'[set size of line]:number of characters per line' \ "$@" else of='-c -e -f'