[Git][NTPsec/ntpsec][master] ntpq interactive switch shot by firing squad for redundancy

Ian Bruene gitlab at mg.gitlab.com
Fri Jun 9 20:47:46 UTC 2017

Ian Bruene pushed to branch master at NTPsec / ntpsec

7be3903a by Ian Bruene at 2017-06-09T20:39:31+00:00
ntpq interactive switch shot by firing squad for redundancy

Either receives a command through -c or -p and won't have a prompt,
or it does not and will have a prompt. The -i switch can't do anything.

- - - - -

2 changed files:

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


--- a/docs/includes/ntpq-body.txt
+++ b/docs/includes/ntpq-body.txt
@@ -72,9 +72,6 @@ attempt to read interactive format commands from the standard input.
   The debug level is set to the following integer argument.
 +-h+, +--help+::
   Print a usage message summarizing options end exit.
-+-i+, +--interactive+::
-  Force +ntpq+ to operate in interactive mode. Prompts will be written
-  to the standard output and commands read from the standard input.
 +-n+, +--numeric+::
   Output all host addresses in numeric format rather than
   converting to the canonical host names.

--- a/ntpclients/ntpq
+++ b/ntpclients/ntpq
@@ -1580,10 +1580,6 @@ USAGE: ntpq [-46dphinOV] [-c str] [-D lvl] [host ...]
    -h no  help            Print a usage message.
    -p no  peers           Print a list of the peers
                                 - prohibits the option 'interactive'
-   -i no  interactive     Force ntpq to operate in interactive mode
-                                - prohibits these options:
-                                command
-                                peers
    -n no  numeric         Numeric host addresses
    -k Str keyfile         Specify a keyfile. ntpq will look in this file
                           for the key specified with -a
@@ -1599,12 +1595,11 @@ if __name__ == '__main__':
         (options, arguments) = getopt.getopt(
-            "46a:c:dD:hk:inpVwW:u",
+            "46a:c:dD:hk:npVwW:u",
             ["ipv4", "ipv6", "authentication=",
              "command=", "debug", "set-debug-level=",
-             "help", "keyfile", "interactive",
-             "numeric", "peers", "version",
-             "wide", "width=", "units"])
+             "help", "keyfile", "numeric", "peers",
+             "version", "wide", "width=", "units"])
     except getopt.GetoptError as e:
         sys.stderr.write("%s\n" % e)
@@ -1639,8 +1634,6 @@ if __name__ == '__main__':
         elif switch in ("-h", "--help"):
             raise SystemExit(0)
-        elif switch in ("-i", "--interactive"):
-            interpreter.interactive = True
         elif switch in ("-n", "--numeric"):
             interpreter.showhostnames = False
         elif switch in ("-p", "--peers"):
@@ -1670,10 +1663,6 @@ if __name__ == '__main__':
     if keyid is not None:  # Have an -a
         session.keyid = keyid
-    if interpreter.interactive and len(interpreter.ccmds) > 0:
-        interpreter.warn("%s: invalid option combination.\n" % progname)
-        raise SystemExit(1)
     for token in arguments:
         if token.startswith("-"):
             if '4' == token[-1]:

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

View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7be3903ac943f08e5d42e67c895f280472393a9d
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/20170609/f97038f0/attachment.html>

More information about the vc mailing list