Bug 247004 - awk(1): -V option is not supported
Summary: awk(1): -V option is not supported
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Pankov
Keywords: patch
: 241552 (view as bug list)
Depends on:
Blocks: 230730
  Show dependency treegraph
Reported: 2020-06-05 14:52 UTC by Zsolt Udvari
Modified: 2020-07-14 20:30 UTC (History)
5 users (show)

See Also:

Proposed patch for awk (854 bytes, patch)
2020-06-06 17:19 UTC, Akos Somfai
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Udvari 2020-06-05 14:52:34 UTC
man awk says:
-V	     Print the version number of awk to	standard output	and exit.

$ 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 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 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

  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

Comment 5 Yuri Pankov freebsd_committer 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 2020-07-14 20:30:00 UTC
*** Bug 241552 has been marked as a duplicate of this bug. ***