RE: [chrony-dev] Testing for option -N support

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


Hi Lonnie,

Using --help looks more natural and less dependent on how other options are parsed:

ARG="" ; chronyc --help | grep -q -- -N && ARG="-N" ; chronyc $ARG sources

Regards,
Frank

-----Original Message-----
From: Lonnie Abelbeck <lists@xxxxxxxxxxxxxxxxxxx> 
Sent: Freitag, 13. Dezember 2019 17:43
To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
Subject: [chrony-dev] Testing for option -N support

Hi Devs,

With the new -N option added in development, there may be cases where web interface frontends may want to use "chronyc -N sources" when chronyc supports it.

As a test for -N, I first tried... 

chronyc -N --version >/dev/null 2>&1

but looking at the code, --version is handled before the -N and always returns 0, then I tried

chronyc -N -v >/dev/null 2>&1

works fine.

The resulting one-liner:
--
ARG="" ; chronyc -N -v >/dev/null 2>&1 && ARG="-N" ; chronyc $ARG sources
--

Lonnie


-- 
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/