-.\" $NetBSD: primes.6,v 1.1 2004/02/08 13:16:25 jsm Exp $
+.\" $NetBSD: primes.6,v 1.3 2008/02/03 03:29:17 wiz Exp $
.\"
.\" Copyright (c) 1989, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" chongo <for a good prime call: 391581 * 2^216193 - 1> /\oo/\
.\"
-.Dd February 8, 2004
+.Dd February 3, 2008
.Dt PRIMES 6
.Os
.Sh NAME
.Nd generate primes
.Sh SYNOPSIS
.Nm primes
+.Op Fl d
.Op Ar start Op Ar stop
.Sh DESCRIPTION
The
.Nm
-utility prints primes in ascending order, one per line, starting at or above
+utility prints primes in ascending order, one per line, starting
+at or above
.Ar start
and continuing until, but not including
.Ar stop .
is taken to be 4294967295.
The
.Ar start
-value may be preceded by a single +.
+value may be preceded by a single
+.Sq \&+ .
The
.Ar start
value is terminated by a non-digit character (such as a newline).
The input line must not be longer than 255 characters.
+When given the
+.Fl d
+argument,
+.Nm
+prints the difference between the current and the previous prime.
.Sh DIAGNOSTICS
Out of range or invalid input results in
an appropriate error message