Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 2019 15:01:11 +0000 (UTC)
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r352578 - head/usr.bin/jot
Message-ID:  <201909211501.x8LF1BvL038297@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: 0mp (ports committer)
Date: Sat Sep 21 15:01:11 2019
New Revision: 352578
URL: https://svnweb.freebsd.org/changeset/base/352578

Log:
  jot.1: Explain default argument values more precisely
  
  The way jot(1) defaults missing arguments doesn't match the behaviour
  described in the manpage, which states that with fewer than 3 arguments
  missing values are supplied from left to right.
  
  In fact, with one or two arguments, the last (s which is step size or seed)
  defaults to 1 (or -1 if begin and end specify a descending range), and then
  omitted arguments are set to default starting with the leftmost until three
  arguments are available.
  
  This is why `jot 2 1000` prints 1000 and 1001 instead of 1000 and 100.
  
  PR:		135475
  Submitted by:	Jonathan McKeown <j.mckeown@ru.ac.za>
  Approved by:	doc (bcr)
  Differential Revision:	https://reviews.freebsd.org/D21736
  Event:		EuroBSDcon 2019

Modified:
  head/usr.bin/jot/jot.1

Modified: head/usr.bin/jot/jot.1
==============================================================================
--- head/usr.bin/jot/jot.1	Sat Sep 21 14:16:37 2019	(r352577)
+++ head/usr.bin/jot/jot.1	Sat Sep 21 15:01:11 2019	(r352578)
@@ -28,7 +28,7 @@
 .\"	@(#)jot.1	8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd April 7, 2015
+.Dd September 21, 2019
 .Dt JOT 1
 .Os
 .Sh NAME
@@ -108,14 +108,16 @@ Any three of these arguments determines the fourth.
 If four are specified and the given and computed values of
 .Ar reps
 conflict, the lower value is used.
-If fewer than three are specified, defaults are assigned
-left to right, except for
+If one or two are specified, defaults are assigned
+starting with
 .Ar s ,
-which assumes a default of 1 or -1 if both
+which assumes a default of 1 (or -1 if
 .Ar begin
 and
 .Ar end
-are given.
+specify a descending range).
+Then the default values are assigned to the leftmost omitted arguments until
+three arguments are set.
 .Pp
 Defaults for the four arguments are, respectively,
 100, 1, 100, and 1, except that when random data are requested,



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