Subject: bug#7877: sleep 5 -4

From: Jim Meyering <[email-masked]>
Date: Tue, 25 Jan 2011 09:36:40 +0100

[email-masked] wrote:
> $ sleep 5 -4
> sleep: invalid option -- '4'
> $ sleep -- 5 -4
> sleep: invalid time interval `-4'
>
> No fair prejudicing negative numbers.
>
> At least document it.
> 'However, GNU `sleep' accepts arbitrary floating point numbers (using a
> period before any fractional digits).' is what it says on Debian.

Hi Dan,

GNU sleep requires nonnegative numbers, so I've mentioned that
in the texinfo documentation.  I nearly made the s/arbitrary/nonnegative/
change to the sentence in both --help and coreutils.texi:

    Unlike most implementations that require NUMBER be an integer,
    here NUMBER may be an arbitrary floating point number.

But that seemed counterproductive, since we're making the contrast
between integer and FP.  Adding "nonnegative" there would detract.

Other implementations accept only a single argument,
so negative numbers would not make sense.

>From 228b7b3c85b85a14b702aac1642b931798916809 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email-masked]>
Date: Tue, 25 Jan 2011 09:22:37 +0100
Subject: [PATCH] doc: mention that each sleep argument must be nonnegative

* doc/coreutils.texi (sleep invocation): Document that arguments
must be nonnegative.  Reported by Dan Jacobson.
---
 doc/coreutils.texi |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index ebe379e..398e20c 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -15674,7 +15674,7 @@ sleep invocation
 @end example

 @cindex time units
-Each argument is a number followed by an optional unit; the default
+Each argument is a nonnegative number followed by an optional unit; the default
 is seconds.  The units are:

 @table @samp
--
1.7.3.5.38.gb312b