[Git][NTPsec/ntpsec][master] ntpmon: Add "-n"/"--numeric" option

Eric S. Raymond gitlab at mg.gitlab.com
Tue May 2 14:12:13 UTC 2017


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


Commits:
7e4cf714 by Matt Nordhoff at 2017-05-02T10:11:17-04:00
ntpmon: Add "-n"/"--numeric" option

- - - - -


2 changed files:

- docs/includes/ntpmon-body.txt
- ntpclients/ntpmon


Changes:

=====================================
docs/includes/ntpmon-body.txt
=====================================
--- a/docs/includes/ntpmon-body.txt
+++ b/docs/includes/ntpmon-body.txt
@@ -55,7 +55,7 @@ k:: Select previous peer (in select mode); arrow up also works.
 
 m:: Toggle MRUlist-only mode; suppresses peer display when on.
 
-n:: Toggle display of hostnames (vs. IP addresses).
+n:: Toggle display of hostnames vs. IP addresses (default is hostnames).
 
 o:: Change peer display to opeers mode, showing destination address.
 
@@ -81,6 +81,8 @@ x:: Cleanly terminate the program.
 
 == Options ==
 
+-n:: Show IP addresses (vs. hostnames)
+
 -u:: Show units
 
 -V:: Display version and exit.


=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -167,13 +167,14 @@ class OutputContext:
         curses.endwin()
 
 usage = '''
-USAGE: ntpmon [-u] [-V] [host]
+USAGE: ntpmon [-n] [-u] [-V] [host]
 '''
 
 if __name__ == '__main__':
     try:
         (options, arguments) = getopt.getopt(sys.argv[1:],
-                                             "Vu", ["version", "units"])
+                                             "Vnu",
+                                             ["version", "numeric", "units"])
     except getopt.GetoptError as e:
         sys.stderr.write("%s\n" % e)
         sys.stderr.write(usage)
@@ -191,6 +192,8 @@ if __name__ == '__main__':
         if switch in ("-V", "--version"):
             print("ntpmon %s" % ntp.util.stdversion())
             raise SystemExit(0)
+        elif switch in ("-n", "--numeric"):
+            showhostnames = False
         elif switch in ("-u", "--units"):
             showunits = True
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7e4cf714c505e41f2540498153b79e30d30e5ad7

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7e4cf714c505e41f2540498153b79e30d30e5ad7
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170502/c15ad3a6/attachment.html>


More information about the vc mailing list