Yo Eric!
Just look at the old ntpq:
dagwood ~ # ntpq -O -c "rv 0 frequency" spidey
associd=0 status=0418 leap_none, sync_uhf_radio, 1 event, no_sys_peer,
frequency=-0.611
dagwood ~ # ntpq -c "rv 0 frequency" spidey
frequency=-0.588
dagwood ~ #
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
[email protected] Tel:+1 541 382 8588
Begin forwarded message:
Date: Tue, 08 Nov 2016 13:20:47 +0000
From: "Eric S. Raymond" <[email protected]>
To: [email protected]
Subject: [Git][NTPsec/ntpsec][master] Retire ntpq's -O option. It's
unclear how to do it right.
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
80a24b8c by Eric S. Raymond at 2016-11-08T08:19:51-05:00
Retire ntpq's -O option. It's unclear how to do it right.
- - - - -
2 changed files:
- docs/includes/ntpq-body.txt
- ntpq/ntpq
Changes:
=====================================
docs/includes/ntpq-body.txt
=====================================
--- a/docs/includes/ntpq-body.txt
+++ b/docs/includes/ntpq-body.txt
@@ -74,9 +74,6 @@ attempt to read interactive format commands from the
standard input. +-n+, +--numeric+::
Output all host addresses in numeric format rather than
converting to the canonical host names.
-+-O+, +--old-rv+::
- Print an extra line when reading a single value with rv,
- for example +ntpq -O -c "rv 0 frequency"+
+-p+, +--peers+::
Print a list of the peers known to the server as well as a summary of
their state. This is equivalent to the +peers+ interactive command.
@@ -563,4 +560,6 @@ In older versions, the 'type' variable associated
with a reference clock was a numeric driver type index. It has been
replaced by 'name', a shortname for the driver type.
+The -O (--old-rv) option of legacy versions has been retired.
+
// end
=====================================
ntpq/ntpq
=====================================
--- a/ntpq/ntpq
+++ b/ntpq/ntpq
@@ -140,7 +140,6 @@ class Ntpq(cmd.Cmd):
self.session = session
self.prompt = "ntpq> "
self.interactive = False # set to True when we
should prompt
- self.old_rv = False # use old readvars
behavior? #self.auth_keyid = 0 # Keyid used for
authentication. #self.auth_keytype = "NID_md5" # MD5 (FIXME:
string value is a dummy) #self.auth_hashlen = 16 # MD5
@@ -444,12 +443,6 @@ usage: help [ command ]
def __dolist(self, varlist, associd, op, type):
"List variables associated with a specified peer."
- # if we're asking for specific variables don't include the
- # status header line in the output.
- if self.old_rv:
- quiet = False
- else:
- quiet = not (not varlist) # nonempty?
try:
variables = self.session.readvar(associd, varlist, op)
except Mode6Exception as e:
@@ -471,7 +464,7 @@ usage: help [ command ]
return True
if not quiet:
self.say("associd=%d " % associd)
- self.printvars(variables, type, quiet)
+ self.printvars(variables, type, not (not varlist))
return True
# Unexposed helper tables and functions end here
@@ -1490,7 +1483,6 @@ USAGE: ntpq [-46dphinOV] [-c str] [-D lvl]
[ host ...] command
peers
-n no numeric numeric host addresses
- -O no old-rv Always output status line with readvar
-V opt version Output version information and exit
-w no wide enable wide display of addresses
'''
@@ -1501,11 +1493,11 @@ if __name__ == '__main__':
try:
(options, arguments) = getopt.getopt(sys.argv[1:],
- "46c:dD:hinOpVw",
+ "46c:dD:hinpVw",
["ipv4","ipv6", "command",
"debug",
"set-debug-level", "help", "interactive", "numeric",
- "old-rv", "peers",
"version",
+ "peers", "version",
"wide"])
except getopt.GetoptError as e:
print(e)
@@ -1534,8 +1526,6 @@ if __name__ == '__main__':
interpreter.interactive = True
elif switch in ("-n", "--numeric"):
interpreter.showhostnames = False
- elif switch in ("-O", "--old-rv"):
- interpreter.old_rv = True
elif switch in ("-p", "--peers"):
interpreter.ccmds.append("peers")
elif switch in ("-V", "--version"):
View it on GitLab:
https://gitlab.com/NTPsec/ntpsec/commit/80a24b8cbe20fd465a97b0916136905fcec0e436
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
[email protected] Tel:+1 541 382 8588
Title:
GitLab
Eric S. Raymond pushed to branch master
at NTPsec / ntpsec
Commits:
2 changed files:
Changes:
docs/includes/ntpq-body.txt
| ... |
... |
@@ -74,9 +74,6 @@ attempt to read interactive format commands from the standard input. |
|
74
|
74
|
+-n+, +--numeric+::
|
|
75
|
75
|
Output all host addresses in numeric format rather than
|
|
76
|
76
|
converting to the canonical host names.
|
|
77
|
|
+-O+, +--old-rv+::
|
|
78
|
|
Print an extra line when reading a single value with rv,
|
|
79
|
|
for example +ntpq -O -c "rv 0 frequency"+
|
|
80
|
77
|
+-p+, +--peers+::
|
|
81
|
78
|
Print a list of the peers known to the server as well as a summary of
|
|
82
|
79
|
their state. This is equivalent to the +peers+ interactive command.
|
| ... |
... |
@@ -563,4 +560,6 @@ In older versions, the 'type' variable associated with a |
|
563
|
560
|
reference clock was a numeric driver type index. It has been replaced
|
|
564
|
561
|
by 'name', a shortname for the driver type.
|
|
565
|
562
|
|
|
|
563
|
The -O (--old-rv) option of legacy versions has been retired.
|
|
|
564
|
|
|
566
|
565
|
// end
|
ntpq/ntpq
| ... |
... |
@@ -140,7 +140,6 @@ class Ntpq(cmd.Cmd): |
|
140
|
140
|
self.session = session
|
|
141
|
141
|
self.prompt = "ntpq> "
|
|
142
|
142
|
self.interactive = False # set to True when we should prompt
|
|
143
|
|
self.old_rv = False # use old readvars behavior?
|
|
144
|
143
|
#self.auth_keyid = 0 # Keyid used for authentication.
|
|
145
|
144
|
#self.auth_keytype = "NID_md5" # MD5 (FIXME: string value is a dummy)
|
|
146
|
145
|
#self.auth_hashlen = 16 # MD5
|
| ... |
... |
@@ -444,12 +443,6 @@ usage: help [ command ] |
|
444
|
443
|
|
|
445
|
444
|
def __dolist(self, varlist, associd, op, type):
|
|
446
|
445
|
"List variables associated with a specified peer."
|
|
447
|
|
# if we're asking for specific variables don't include the
|
|
448
|
|
# status header line in the output.
|
|
449
|
|
if self.old_rv:
|
|
450
|
|
quiet = False
|
|
451
|
|
else:
|
|
452
|
|
quiet = not (not varlist) # nonempty?
|
|
453
|
446
|
try:
|
|
454
|
447
|
variables = self.session.readvar(associd, varlist, op)
|
|
455
|
448
|
except Mode6Exception as e:
|
| ... |
... |
@@ -471,7 +464,7 @@ usage: help [ command ] |
|
471
|
464
|
return True
|
|
472
|
465
|
if not quiet:
|
|
473
|
466
|
self.say("associd=%d " % associd)
|
|
474
|
|
self.printvars(variables, type, quiet)
|
|
|
467
|
self.printvars(variables, type, not (not varlist))
|
|
475
|
468
|
return True
|
|
476
|
469
|
|
|
477
|
470
|
# Unexposed helper tables and functions end here
|
| ... |
... |
@@ -1490,7 +1483,6 @@ USAGE: ntpq [-46dphinOV] [-c str] [-D lvl] [ host ...] |
|
1490
|
1483
|
command
|
|
1491
|
1484
|
peers
|
|
1492
|
1485
|
-n no numeric numeric host addresses
|
|
1493
|
|
-O no old-rv Always output status line with readvar
|
|
1494
|
1486
|
-V opt version Output version information and exit
|
|
1495
|
1487
|
-w no wide enable wide display of addresses
|
|
1496
|
1488
|
'''
|
| ... |
... |
@@ -1501,11 +1493,11 @@ if __name__ == '__main__': |
|
1501
|
1493
|
|
|
1502
|
1494
|
try:
|
|
1503
|
1495
|
(options, arguments) = getopt.getopt(sys.argv[1:],
|
|
1504
|
|
"46c:dD:hinOpVw",
|
|
|
1496
|
"46c:dD:hinpVw",
|
|
1505
|
1497
|
["ipv4","ipv6", "command",
|
|
1506
|
1498
|
"debug", "set-debug-level",
|
|
1507
|
1499
|
"help", "interactive", "numeric",
|
|
1508
|
|
"old-rv", "peers", "version",
|
|
|
1500
|
"peers", "version",
|
|
1509
|
1501
|
"wide"])
|
|
1510
|
1502
|
except getopt.GetoptError as e:
|
|
1511
|
1503
|
print(e)
|
| ... |
... |
@@ -1534,8 +1526,6 @@ if __name__ == '__main__': |
|
1534
|
1526
|
interpreter.interactive = True
|
|
1535
|
1527
|
elif switch in ("-n", "--numeric"):
|
|
1536
|
1528
|
interpreter.showhostnames = False
|
|
1537
|
|
elif switch in ("-O", "--old-rv"):
|
|
1538
|
|
interpreter.old_rv = True
|
|
1539
|
1529
|
elif switch in ("-p", "--peers"):
|
|
1540
|
1530
|
interpreter.ccmds.append("peers")
|
|
1541
|
1531
|
elif switch in ("-V", "--version"):
|
_______________________________________________
vc mailing list
[email protected]
http://lists.ntpsec.org/mailman/listinfo/vc
pgpu0NMAIbN6N.pgp
Description: OpenPGP digital signature
_______________________________________________
devel mailing list
[email protected]
http://lists.ntpsec.org/mailman/listinfo/devel