Bug 181645

Summary: [patch] ntpq(8): ntpq -d flag does not work
Product: Base System Reporter: Marco Hoehle <marco.hoehle>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me Keywords: patch
Priority: Normal    
Version: 9.1-RELEASE   
Hardware: Any   
OS: Any   

Description Marco Hoehle 2013-08-29 11:10:00 UTC
In the manpage for ntpq the "debug" flag is explained but it does not work.

See example:

[hoehle@urz-hoehle-fbsd ~]$ man ntpq | grep "\-d"
     -d      Turn on debugging mode.

[hoehle@urz-hoehle-fbsd ~]$ ntpq -d
ntpq: illegal option -- d
ntpq - standard NTP query program - Ver. 4.2.4p8

Fix: 

Either update the manpage or add the flag ;-)
How-To-Repeat: 

test doc:
> man ntpq | grep "\-d"

test binary:
> ntpq -d
Comment 1 Rodrigo OSORIO 2013-08-29 14:14:35 UTC
> >Description:
> In the manpage for ntpq the "debug" flag is explained but it does not work.
> 
> See example:
> 
> [hoehle@urz-hoehle-fbsd ~]$ man ntpq | grep "\-d"
>      -d      Turn on debugging mode.
> 
> [hoehle@urz-hoehle-fbsd ~]$ ntpq -d
> ntpq: illegal option -- d
> ntpq - standard NTP query program - Ver. 4.2.4p8
> 
> test doc:
> > man ntpq | grep "\-d"
> 
> test binary:
> > ntpq -d
> 
> >Fix:
> 
> Either update the manpage or add the flag ;-)
> 

Apparently we forgot the -DDEBUG flag in usr.sbin/ntp/ntpq/Makefile
to enable the debug options.

Index: Makefile
===================================================================
--- Makefile    (revision 253954)
+++ Makefile    (working copy)
@@ -19,7 +19,7 @@
 
 DPADD+=                ${LIBEDIT} ${LIBTERMCAP}
 LDADD+=                -ledit -ltermcap
-CFLAGS+=       -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
+CFLAGS+=       -DDEBUG -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
                -I${DESTDIR}/${INCLUDEDIR}/edit
 
 CLEANFILES+= .version version.c
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:25 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:38:58 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>