bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] dnsdomainname, domainname, nisdomainname, ypdomainna


From: Simon Josefsson
Subject: Re: [bug-inetutils] dnsdomainname, domainname, nisdomainname, ypdomainname
Date: Thu, 8 Mar 2012 21:55:53 +0100 (CET)
User-agent: SquirrelMail/1.4.15

>    1) Write small compatibility shell scripts that invoke 'hostname' with
>    the right parameters.  For example, the 'dnsdomainname' script would
>    invoke 'hostname -d'.
>
> This would cause problems if you do --disable-hostname
> --enable-dnsdomainname; and where the system hostname does not provide
> the -d flag for whatever reason or prints the results in a non IU
> fashion.

Yeah, that approach would require that if any of the *name scripts are
installed, the hostname binary needs to be installed.

>    2) Extend the 'hostname' tool to allow that argv[0] influence its mode
>    of operation.  This is how Net-Tools work today, they have only one
>    program but it is hardlinked to all these names.  Letting argv[0]
>    influence mode of operation is a bit ugly, but there are some precedent
>    for it even in well-maintained projects like CoreUtils.
>
> I'm quite sure coreutils doesn't depend on the value of argv[0]; it is
> also discouraged in the GCS.

At least the 'test' tool inspects argv0 to see whether it should operate
in normal test mode or the [ mode.

>    3) Install separate tools that implement the operation.  This would
>    result in better documentation, better --help output, etc.  Technically
>    the tools could share most of the code and simply use some #define and
>    #include's for the gist of the operations.
>
> This is my favourite one; this would be very similar to true/false in
> coreutils.  But requires the most work.

It is also my preference.  Unless there are other voices within a few
days, I'll propose something along these lines.  Additional thoughts or
comments still welcome!

/Simon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]