Steven Augart <[EMAIL PROTECTED]> wrote: > I looked through the Open Group documents that the letters you sent me > pointed to. I'm not clear on whether it's required to reject unknown > arguments starting with a - but not after a --. That would significantly > influence my implementation -- I would prefer to have hostname work like > this: > > hostname foo.bar.com > Sets the hostname > hostname --fqdn > retrieves the hostname as an FQDN > hostname -f > ditto > hostname --long-option-I-never-heard-of > rejected with a usage message > hostname -- --long-option-I-never-heard-of > sets the host name to --long-option-I-never-heard-of
That sounds like the way to go, once the program accepts options. > But I'm wondering if there might be a reason that coreutils's "hostname" > recognizes > --help and --version but takes --anything-else as being a hostname. Is > there a reference that implies that the current behaviour is preferred? Some GNU programs accept only --help and --version options, I'm careful to make it so they recognize such an option only when it is alone on the command line. Also, the implementation must be careful not to use getopt or getopt_long -- which can gobble up the `--' separator. Some programs (e.g., test, yes) treat `--' like an argument like any other. _______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-coreutils
