[Git][NTPsec/ntpsec][master] pyntpq: apeers display is working.

Eric S. Raymond gitlab at mg.gitlab.com
Sun Oct 23 04:11:57 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
330566db by Eric S. Raymond at 2016-10-23T00:11:32-04:00
pyntpq: apeers display is working.

- - - - -


1 changed file:

- ntpq/pyntpq


Changes:

=====================================
ntpq/pyntpq
=====================================
--- a/ntpq/pyntpq
+++ b/ntpq/pyntpq
@@ -457,13 +457,16 @@ usage: help [ command ]
                 sys.stdout.write("%c%-15.15s " % \
                                  (c, clock_name[:namewidth]))
             # Destination address, assoc ID or refid.
-            assocwidth = 9 if "assoc" in header else 0
+            assocwidth = 7 if "assid" in header else 0
             if "." not in dstadr_refid:
                 dstadr_refid = "." + dstadr_refid + "."
-            visible = dstadr_refid[:addrwidth - assocwidth]
+            if assocwidth and len(dstadr_refid) >= addrwidth - assocwidth:
+                visible = "..."
+            else:
+                visible = dstadr_refid
             sys.stdout.write(visible)
-            if "assoc" in header:
-                sys.stdout.write(" " * (addwidth - len(visible) - assocwidth))
+            if "assid" in header:
+                sys.stdout.write(" " * (addrwidth - len(visible) - assocwidth + 1))
                 sys.stdout.write("%-6d" % (associd))
             else:
                 sys.stdout.write(" " * (addrwidth - len(visible)))



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/330566dba2b271f9be5f15dad2915b4f5a29368d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161023/2741f41e/attachment.html>


More information about the vc mailing list