Bug 59991

Summary: diff manpage lacks a return value section
Product: Documentation Reporter: Erik Greenwald <erik>
Component: Books & ArticlesAssignee: Ceri Davies <ceri>
Status: Closed FIXED    
Severity: Affects Only Me CC: erik
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
diff.1.patch none

Description Erik Greenwald 2003-12-06 16:00:36 UTC
No text indicates what return values to expect from diff...
Comment 1 Giorgos Keramidas freebsd_committer freebsd_triage 2004-01-01 11:20:36 UTC
On 2003-12-06 15:57, Erik Greenwald <erik@smluc.org> wrote:
> No text indicates what return values to expect from diff...
> [...]
> --- diff.1.patch begins here ---
> --- gnu/usr.bin/diff/diff.1.orig	Sat Dec  6 10:48:42 2003
> +++ gnu/usr.bin/diff/diff.1	Sat Dec  6 10:54:16 2003
> @@ -474,6 +474,10 @@
>  .TP
>  .B \-y
>  Use the side by side output format.
> +.SH RETURN VALUE
> +.I diff
> +returns a 0 if the files are identical or a 1 if the files differ. If one or
> +both of the files cannot be opened, then the return value is set to 2.
>  .SH ENVIRONMENT
>  The environment variable
>  .B DIFF_OPTIONS

Nice catch!

Note, though, that it is a good practice to start a new line with every new
sentence, when writing manpages.  I'd probably write the same diff without
the 'a' article before numbers too:

%%%
--- gnu/usr.bin/diff/diff.1.orig	Sat Dec  6 10:48:42 2003
+++ gnu/usr.bin/diff/diff.1	Sat Dec  6 10:54:16 2003
@@ -474,6 +474,11 @@
 .TP
 .B \-y
 Use the side by side output format.
+.SH RETURN VALUE
+.I diff
+returns 0 if the files are identical or 1 if the files differ.
+If one or both of the files cannot be opened,
+then the return value is set to 2.
 .SH ENVIRONMENT
 The environment variable
 .B DIFF_OPTIONS
%%%
Comment 2 Ceri Davies freebsd_committer freebsd_triage 2004-01-26 18:56:32 UTC
Responsible Changed
From-To: freebsd-doc->ceri

I'll take this.
Comment 3 Ceri Davies freebsd_committer freebsd_triage 2004-02-01 13:52:27 UTC
State Changed
From-To: open->patched

Patched in -HEAD.
Comment 4 Erik Greenwald 2004-08-25 15:30:05 UTC
ehhh, this should probably be backed out. The info is in the
'diagnostics' section, I must've missed that. My bad, sorry

-- 
        -Erik <erik@smluc.org> [http://math.smsu.edu/~erik]

The opinions expressed by me are not necessarily opinions. In all probability,
they are random rambling, and to be ignored. Failure to ignore may result in
severe boredom or confusion. Shake well before opening. Keep Refrigerated.
Comment 5 Ceri Davies freebsd_committer freebsd_triage 2004-11-28 18:54:47 UTC
State Changed
From-To: patched->closed

This turned out to be unnecessary - keramida backed out the changes I 
had made (thanks).  Thanks to the submitter for the report, anyhow.