Bug 247004

Summary: awk(1): -V option is not supported
Product: Base System Reporter: Zsolt Udvari <uzsolt>
Component: binAssignee: Yuri Pankov <yuripv>
Status: Closed FIXED    
Severity: Affects Only Me CC: akos.somfai, bugs, deepbluemistake, samy.mahmoudi, yuripv
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: https://reviews.freebsd.org/D25164
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241552
Bug Depends on:    
Bug Blocks: 230730    
Attachments:
Description Flags
Proposed patch for awk none

Description Zsolt Udvari freebsd_committer freebsd_triage 2020-06-05 14:52:34 UTC
man awk says:
-V	     Print the version number of awk to	standard output	and exit.

But:
$ awk -V
awk: unknown option -V ignored

awk: no program given


Only the --version works but it doesn't appear in man page.
Comment 1 Akos Somfai 2020-06-06 17:18:46 UTC
Maybe we can add "-V" support for awk as manpage already mentions it and the change seems trivial.
Adding a patch.
Comment 2 Akos Somfai 2020-06-06 17:19:33 UTC
Created attachment 215298 [details]
Proposed patch for awk
Comment 3 Yuri Pankov freebsd_committer freebsd_triage 2020-06-06 17:26:20 UTC
I have opened https://reviews.freebsd.org/D25164 to clean up this and some other small issues with the man page instead as awk is contributed source and already has means to display version.  -V seems to be OpenBSD specific and was added for compatibility (with previous implementation they had) long time ago.  In any case, let's see what others think about this (review).
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-06-13 09:16:26 UTC
A commit references this bug:

Author: yuripv
Date: Sat Jun 13 09:16:07 UTC 2020
New revision: 362147
URL: https://svnweb.freebsd.org/changeset/base/362147

Log:
  awk(1): use -version instead of -V

  -V is OpenBSD specific, use -version instead.

  While here, fix issue reported by mandoc lint and drop nonexistent
  script(7) reference.

  PR:		247004
  Reviewed by:	0mp, markj
  Differential Revision:	https://reviews.freebsd.org/D25164

Changes:
  head/usr.bin/awk/awk.1
Comment 5 Yuri Pankov freebsd_committer freebsd_triage 2020-06-13 09:18:50 UTC
(In reply to Akos Somfai from comment #1)
I have decided to document -version instead, to skip changes to contributed source.  Thanks for your submission though, please keep them coming!
Comment 6 Samy Mahmoudi 2020-06-13 12:54:03 UTC
Thank you for the report, review and commit.

There seems to be another issue related to documentation of FS, described in bug 226112.

Following another caught on -V/--version, reviewing the whole awk(1) manpage was also discussed (bug 230730).
Comment 7 Akos Somfai 2020-06-13 20:45:48 UTC
(In reply to Yuri Pankov from comment #5)
Sure, thanks.
Comment 8 Gordon Bergling freebsd_committer freebsd_triage 2020-07-14 20:30:00 UTC
*** Bug 241552 has been marked as a duplicate of this bug. ***
Comment 9 commit-hook freebsd_committer freebsd_triage 2020-12-08 08:21:10 UTC
A commit references this bug:

Author: yuripv
Date: Tue Dec  8 08:20:30 UTC 2020
New revision: 368438
URL: https://svnweb.freebsd.org/changeset/base/368438

Log:
  MFC r362147:

  awk(1): use -version instead of -V

  -V is OpenBSD specific, use -version instead.

  While here, fix issue reported by mandoc lint and drop nonexistent
  script(7) reference.

  PR:		247004

Changes:
_U  stable/12/
  stable/12/usr.bin/awk/awk.1