Bug 135475 - [patch] jot(1) manpage and behaviour differ
Summary: [patch] jot(1) manpage and behaviour differ
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mateusz Piotrowski
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-06-11 13:40 UTC by Jonathan McKeown
Modified: 2019-09-21 15:11 UTC (History)
2 users (show)

See Also:


Attachments
jotdiff.txt (733 bytes, text/plain; charset="iso 8859-15")
2009-06-11 14:03 UTC, Jonathan McKeown
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan McKeown 2009-06-11 13:40:03 UTC
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.

Fix: 

I have attached a patch to the manpage.
Comment 1 Jonathan McKeown 2009-06-11 14:03:35 UTC
And here's the patch.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2012-02-23 02:54:10 UTC
Responsible Changed
From-To: freebsd-doc->eadler

I'll take it.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2012-06-24 21:57:52 UTC
Responsible Changed
From-To: eadler->freebsd-bugs

not dealing with this for a while
Comment 4 Mateusz Piotrowski freebsd_committer freebsd_triage 2019-09-21 14:37:07 UTC
I'll take a look.
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-09-21 15:02:11 UTC
A commit references this bug:

Author: 0mp
Date: Sat Sep 21 15:01:12 UTC 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

Changes:
  head/usr.bin/jot/jot.1
Comment 6 Mateusz Piotrowski freebsd_committer freebsd_triage 2019-09-21 15:11:07 UTC
Thanks a lot for the patch. I'm sorry it took so long.