[Nut-upsdev] upscli_splitname() for upsc_list (was: Re: Default NUT

Charles Lepple clepple at gmail.com
Mon Jan 15 14:04:07 CET 2007


On 1/15/07, Arjen de Korte <nut+devel at de-korte.org> wrote:
>
> >> For some time, I have considered making a dual suggestion: to make the
> >> hostname optional. For a large percentage of users, the hostname is
> >> always equal to "localhost". I don't know how many times I mistakenly
> >> typed "upsc apc" instead of "upsc apc at localhost". I would be very
> >> happy if "localhost" were the default.
> > Agreed, localhost makes sense as a default, since that's the most
> > likely host for testing drivers.
>
> As I wrote just a while ago in my reply to Peter, is it wise to define
> these defaults in the API? I'm also not entirely happy with the parsing of
> command line arguments in the upsclient API. I would prefer to see parsing
> command line arguments in a separate module, much like parseconf.c we have
> now for parsing the configuration files. Probably some other things might
> be shared between clients that way too.

I don't think we should encourage too many different ways to parse the
name. But I think we've made a case for having the original upsc
syntax as well as something slightly different for specifying an
instance of upsd (just hostname and port, with another command-line
flag warning the code that the syntax is different).

That is all that I am trying to work out right now. I am indifferent
as to whether we move upscli_splitname() into a different module, so I
am not inclined to actually set that up myself. But it can be moved
later, so long as we document these changes for people writing
clients.

-- 
- Charles Lepple



More information about the Nut-upsdev mailing list