RFC 4330 (and newer) say that the default multicast address for broadcast sntp time updates is 224.0.1.1 so I want "sntp -m" to have an optional argument overriding that, but otherwise take the default.
Unfortunately, "optional aguments" exist but aren't used much. For example --color is technically --color=auto (and can also take --color=always and --color=never)... but actualy looking at what's after the = is still a todo item for ls. (I think I might have done it in grep? I'd have to check. I _do_ have a note that I should try to factor out common code there into lib...) For optional longopts, you have to go =argument, for optional short options you have to collate, in this case it would look like: sntp -m224.0.1.1 If you have a space it instead thinks you're going "sntp 224.0.1.1 -m", because that's how optional arguments work. (And yes this means you can sntp -sM but not sntp -Ms .) The _problem_ is, even though I have this mechanism... I have no idea how to usefully describe in the help text so users know what to do? I don't really have a "usage: blah [-abc] ARG..." syntax for it, and even if I did it's not in widespread enough use I'd expect people to pick it up? I added a "[-mADDRESS]" entry to the command line but it's too subtle... Not sure what to do about that. For the moment, I guess -m requires the argument? (Yes, somebody is still using multicast for something. In 2019. I know, but there's a user waiting...) Trying to cut a release and promoting sntp is the most prominent remaining todo item... Rob _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
