From owner-svn-src-all@freebsd.org Tue May 31 07:50:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A659FB55B91; Tue, 31 May 2016 07:50:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 801E71B16; Tue, 31 May 2016 07:50:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4V7nxpH000299; Tue, 31 May 2016 07:49:59 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4V7nxaB000298; Tue, 31 May 2016 07:49:59 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201605310749.u4V7nxaB000298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 May 2016 07:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301025 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 07:50:00 -0000 Author: trasz Date: Tue May 31 07:49:59 2016 New Revision: 301025 URL: https://svnweb.freebsd.org/changeset/base/301025 Log: Make iscsictl(8) error messages more consistent. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/iscsictl/iscsictl.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Tue May 31 06:45:19 2016 (r301024) +++ head/usr.bin/iscsictl/iscsictl.c Tue May 31 07:49:59 2016 (r301025) @@ -837,10 +837,6 @@ main(int argc, char **argv) if (session_id == -1) xo_errx(1, "-M requires -i"); - if (discovery_host != NULL) - xo_errx(1, "-M and -d are mutually exclusive"); - if (aflag != 0) - xo_errx(1, "-M and -a are mutually exclusive"); if (nickname != NULL) { if (portal != NULL) xo_errx(1, "-n and -p and mutually exclusive"); @@ -852,6 +848,10 @@ main(int argc, char **argv) xo_errx(1, "-n and -s and mutually exclusive"); } + if (aflag != 0) + xo_errx(1, "-a cannot be used with -M"); + if (discovery_host != NULL) + xo_errx(1, "-d cannot be used with -M"); if (rflag != 0) xo_errx(1, "-r cannot be used with -M"); if (vflag != 0) @@ -860,13 +860,6 @@ main(int argc, char **argv) xo_errx(1, "-w cannot be used with -M"); } else if (Rflag != 0) { - if (user != NULL) - xo_errx(1, "-R and -u are mutually exclusive"); - if (secret != NULL) - xo_errx(1, "-R and -s are mutually exclusive"); - if (discovery_host != NULL) - xo_errx(1, "-R and -d are mutually exclusive"); - if (aflag != 0) { if (portal != NULL) xo_errx(1, "-a and -p and mutually exclusive"); @@ -883,10 +876,16 @@ main(int argc, char **argv) xo_errx(1, "must specify either -a, -n, -t, or -p"); } + if (discovery_host != NULL) + xo_errx(1, "-d cannot be used with -R"); if (session_id != -1) xo_errx(1, "-i cannot be used with -R"); if (rflag != 0) xo_errx(1, "-r cannot be used with -R"); + if (user != NULL) + xo_errx(1, "-u cannot be used with -R"); + if (secret != NULL) + xo_errx(1, "-s cannot be used with -R"); if (vflag != 0) xo_errx(1, "-v cannot be used with -R"); if (timeout != -1) @@ -895,23 +894,22 @@ main(int argc, char **argv) } else { assert(Lflag != 0); + if (discovery_host != NULL) + xo_errx(1, "-d cannot be used with -L"); + if (session_id != -1) + xo_errx(1, "-i cannot be used with -L"); + if (nickname != NULL) + xo_errx(1, "-n cannot be used with -L"); if (portal != NULL) - xo_errx(1, "-L and -p and mutually exclusive"); + xo_errx(1, "-p cannot be used with -L"); + if (rflag != 0) + xo_errx(1, "-r cannot be used with -L"); if (target != NULL) - xo_errx(1, "-L and -t and mutually exclusive"); + xo_errx(1, "-t cannot be used with -L"); if (user != NULL) - xo_errx(1, "-L and -u and mutually exclusive"); + xo_errx(1, "-u cannot be used with -L"); if (secret != NULL) - xo_errx(1, "-L and -s and mutually exclusive"); - if (nickname != NULL) - xo_errx(1, "-L and -n and mutually exclusive"); - if (discovery_host != NULL) - xo_errx(1, "-L and -d and mutually exclusive"); - if (rflag != 0) - xo_errx(1, "-L and -r and mutually exclusive"); - - if (session_id != -1) - xo_errx(1, "-i cannot be used with -L"); + xo_errx(1, "-s cannot be used with -L"); } iscsi_fd = open(ISCSI_PATH, O_RDWR);