public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/emacs-tools:eselect-emacs commit in: /
Date: Mon, 21 Aug 2023 06:31:55 +0000 (UTC)	[thread overview]
Message-ID: <1692561397.f544817c6c3bf6820f349feffbbde2a73f2b7fd5.ulm@gentoo> (raw)

commit:     f544817c6c3bf6820f349feffbbde2a73f2b7fd5
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 20 19:56:37 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> 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 <ulm <AT> 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  <ulm@gentoo.org>
+
+	* 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  <ulm@gentoo.org>
 
 	* 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


             reply	other threads:[~2023-08-21  6:32 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  6:31 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-01-05 20:59 [gentoo-commits] proj/emacs-tools:eselect-emacs commit in: / Ulrich Müller
2021-08-02  8:05 Ulrich Müller
2021-07-31 17:39 Ulrich Müller
2018-09-16 14:50 Ulrich Müller
2014-12-23  9:55 Ulrich Müller
2014-12-19 19:03 Ulrich Müller
2014-12-19  7:28 Ulrich Müller
2014-12-19  7:28 Ulrich Müller
2014-12-19  7:28 Ulrich Müller
2014-12-19  7:28 Ulrich Müller
2014-12-19  7:28 Ulrich Müller
2014-10-28 18:50 Ulrich Müller
2014-04-08 13:13 Ulrich Müller
2014-03-18  8:51 Ulrich Müller
2014-03-13 16:34 Ulrich Müller
2014-03-13 13:49 Ulrich Müller
2014-03-13 13:15 Ulrich Müller
2014-03-13 13:15 Ulrich Müller
2014-02-17 21:38 Ulrich Müller
2014-02-17 21:38 Ulrich Müller
2014-02-17 21:38 Ulrich Müller
2014-02-17 17:46 Ulrich Müller
2013-04-01 12:21 Ulrich Mueller
2012-06-22 16:24 Ulrich Mueller
2012-06-22 16:24 Ulrich Mueller
2012-06-22 16:24 Ulrich Mueller
2012-06-22 15:53 Ulrich Mueller
2012-06-22 15:53 Ulrich Mueller
2012-05-06 18:47 Ulrich Mueller
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping
2012-05-06 16:06 Sebastian Pipping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1692561397.f544817c6c3bf6820f349feffbbde2a73f2b7fd5.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox