bug-coreutils
[Top][All Lists]
Advanced

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

Re: bug in hostname


From: Bruno Haible
Subject: Re: bug in hostname
Date: Wed, 21 Jan 2004 20:26:13 +0100
User-agent: KMail/1.5

Jim Meyering wrote:
> I've begun looking through these and like what I've seen.
> However, I'd prefer to avoid providing short-named options
> for --help and --version.

As you like. I did this for compatibility with the Linux /bin/hostname.
I don't know how important these short options are in practice.

But OTOH, I didn't follow compatibility with Linux /bin/hostname in two
points:
  - When the machine has multiple long names (i.e. some aliases),
    my "hostname -f" prints them all, one per line. Linux "/bin/hostname -f"
    prints only the first one, but has an extra option "-a":
    "/bin/hostname -a" prints the names except the first one, all in one
    line, each followed by a space.
  - "hostname -i" surrounds the IP address with brackets in my implementation,
    whereas it does not in the Linux /bin/hostname.

> If we really want to fail for -s, -f, or -i when setting the hostname,
> then it's best to give an additional diagnostic saying why.
> But wouldn't it be better just to warn or ignore altogether?

I'm not a follower of the "garbage in, garbage out" principle. If some
options are clearly contradictory, it's better to point the human user to
his mistake than to do a random action that fits with one part of the
command line arguments but not with the other part. Especially if the
action is a destructive one, like setting a hostname or removing a file.

Bruno





reply via email to

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