From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8C35C15800A for ; Mon, 21 Aug 2023 06:32:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E14E2BC057; Mon, 21 Aug 2023 06:32:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 276292BC053 for ; Mon, 21 Aug 2023 06:32:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6F82C341234 for ; Mon, 21 Aug 2023 06:31:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E2E541061 for ; Mon, 21 Aug 2023 06:31:55 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1692561397.f544817c6c3bf6820f349feffbbde2a73f2b7fd5.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:eselect-emacs commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog ctags.eselect emacs.eselect X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: f544817c6c3bf6820f349feffbbde2a73f2b7fd5 X-VCS-Branch: eselect-emacs Date: Mon, 21 Aug 2023 06:31:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: be5a0c6d-35cd-4610-b1a3-8da01f932ec8 X-Archives-Hash: ad6070db70a8a05ccebdf9e545b91ee7 commit: f544817c6c3bf6820f349feffbbde2a73f2b7fd5 Author: Ulrich Müller gentoo org> AuthorDate: Sun Aug 20 19:56:37 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Aug 20 19:56:37 2023 +0000 URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=f544817c Avoid "&& die" * ctags.eselect (do_show, do_list, do_set, do_update): * emacs.eselect (do_show, do_list, do_set, do_update): Use positive condition for argument checks. Signed-off-by: Ulrich Müller gentoo.org> ChangeLog | 6 ++++++ ctags.eselect | 12 ++++++------ emacs.eselect | 10 +++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdee010..d954d17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-08-20 Ulrich Müller + + * ctags.eselect (do_show, do_list, do_set, do_update): + * emacs.eselect (do_show, do_list, do_set, do_update): + Use positive condition for argument checks. + 2021-08-02 Ulrich Müller * Version 1.19 released. diff --git a/ctags.eselect b/ctags.eselect index 72c95c9..99be1a6 100644 --- a/ctags.eselect +++ b/ctags.eselect @@ -1,5 +1,5 @@ # -*-eselect-*- -# Copyright 2005-2021 Gentoo Authors +# Copyright 2005-2023 Gentoo Authors # Distributed under the terms of the GNU GPL version 2 or later # # DOCUMENTATION @@ -106,7 +106,7 @@ describe_show() { } do_show() { - [[ $# -gt 0 ]] && die -q "Too many parameters" + [[ $# -eq 0 ]] || die -q "Too many parameters" write_list_start "Current target of ${CTAGS} symlink:" if [[ -L ${EROOT}/usr/bin/${CTAGS} && -e ${EROOT}/usr/bin/${CTAGS} ]] @@ -128,7 +128,7 @@ describe_list() { } do_list() { - [[ $# -gt 0 ]] && die -q "Too many parameters" + [[ $# -eq 0 ]] || die -q "Too many parameters" local i targets targets=( $(find_targets) ) @@ -158,8 +158,8 @@ describe_set_parameters() { } do_set() { - [[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to" - [[ $# -gt 1 ]] && die -q "Too many parameters" + [[ -n $1 ]] || die -q "You didn't tell me what to set the symlink to" + [[ $# -le 1 ]] || die -q "Too many parameters" test_for_root if [[ -e ${EROOT}/usr/bin/${CTAGS} && ! -L ${EROOT}/usr/bin/${CTAGS} ]] @@ -183,7 +183,7 @@ describe_update_options() { do_update() { [[ -z $1 || $1 = ifunset || $1 = --if-unset ]] || die -q "Usage error" [[ -z $2 || $2 = norecursion ]] || die -q "Usage error" - [[ $# -gt 2 ]] && die -q "Too many parameters" + [[ $# -le 2 ]] || die -q "Too many parameters" test_for_root if ! [[ $1 = *if*unset \ diff --git a/emacs.eselect b/emacs.eselect index f3880ed..7c5139c 100644 --- a/emacs.eselect +++ b/emacs.eselect @@ -173,7 +173,7 @@ describe_show() { } do_show() { - [[ $# -gt 0 ]] && die -q "Too many parameters" + [[ $# -eq 0 ]] || die -q "Too many parameters" write_list_start "Current target of Emacs symlink:" if [[ -L ${EROOT}/usr/bin/emacs && -e ${EROOT}/usr/bin/emacs ]]; then @@ -199,7 +199,7 @@ describe_list() { } do_list() { - [[ $# -gt 0 ]] && die -q "Too many parameters" + [[ $# -eq 0 ]] || die -q "Too many parameters" local i targets targets=( $(find_targets) ) @@ -234,8 +234,8 @@ describe_set_parameters() { } do_set() { - [[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to" - [[ $# -gt 1 ]] && die -q "Too many parameters" + [[ -n $1 ]] || die -q "You didn't tell me what to set the symlink to" + [[ $# -le 1 ]] || die -q "Too many parameters" test_for_root if [[ -e ${EROOT}/usr/bin/emacs && ! -L ${EROOT}/usr/bin/emacs ]]; then @@ -260,7 +260,7 @@ describe_update_options() { do_update() { [[ -z $1 || $1 = ifunset || $1 = --if-unset ]] || die -q "Usage error" - [[ $# -gt 1 ]] && die -q "Too many parameters" + [[ $# -le 1 ]] || die -q "Too many parameters" test_for_root if [[ -L ${EROOT}/usr/bin/emacs ]]; then