Proposed argument changes to ntpq (fixing bug #319)

Gary E. Miller gem at rellim.com
Thu Jun 8 22:47:17 UTC 2017


Yo Ian!

On Thu, 8 Jun 2017 17:34:27 -0500
Ian Bruene via devel <devel at ntpsec.org> wrote:

> On 06/08/2017 05:29 PM, Gary E. Miller via devel wrote:
> > NTPsec does not use Python's getopt(). It uses argparse().   
> 
> So the real alternatives here are:
> 
> 1. Have the dual -l/-L flags

Yuck.  Non orthogonal to ntpd.  Allows conflicting options on same
command line.

> 2. Convert ntpq from getopt to argparse

Which I've wanted for a while, it is vastly better than Python getopt.
Python getopt confuses people that expect it to behave like POSIX
getopt.  arparse is already used in these programs:

    contrib/ntpheatusb
    contrib/ntpheat
    ntpclients/ntplogtemp
    ntpclients/ntpviz
    ntpclients/ntploggps

A big win is that argparse automagically creates usage() for you.  Another
is the ability to put options in a command file.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170608/43930786/attachment.bin>


More information about the devel mailing list