Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 1999 00:52:27 +0200 (CEST)
From:      Christian Weisgerber <naddy@mips.rhein-neckar.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/12358: Patch: "camcontrol help" should go to stdout
Message-ID:  <199906222252.AAA02365@bigeye.rhein-neckar.de>

next in thread | raw e-mail | index | archive | help

>Number:         12358
>Category:       bin
>Synopsis:       Patch: "camcontrol help" should go to stdout
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 23 00:40:02 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     Christian Weisgerber
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

n/a

>Description:

"camcontrol help" outputs usage information to stderr rather than
stdout. This is non-standard behavior. Usage information should
only be written to stderr if an error condition has occurred, i.e.
if the arguments don't satisfy the syntax requirements of a command.
An explicit request for a help page is not an error condition.

Somewhat more pragmatically phrased: You should be able to catch the
output of "camcontrol help" with your pager.

>How-To-Repeat:

$ camcontrol help | more

>Fix:

src/sbin/camcontrol/:

--- camcontrol.c.orig	Thu Jun 10 18:14:18 1999
+++ camcontrol.c	Wed Jun 23 00:38:24 1999
@@ -2586,7 +2586,7 @@
 void 
 usage(int verbose)
 {
-	fprintf(stderr,
+	fprintf(verbose ? stdout : stderr,
 "usage:  camcontrol <command>  [device id][generic args][command args]\n"
 "        camcontrol devlist    [-v]\n"
 "        camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n"
@@ -2611,7 +2611,7 @@
 "        camcontrol help\n");
 	if (!verbose)
 		return;
-	fprintf(stderr,
+	fprintf(stdout,
 "Specify one of the following options:\n"
 "devlist     list all CAM devices\n"
 "periphlist  list all CAM peripheral drivers attached to a device\n"

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906222252.AAA02365>