Re: Adding groups to a user

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/22/09 23:20, quoth Tony Nelson:
> On 09-07-22 22:51:23, Steven W. Orr wrote:
> 
>> Right. There's a standard for how command options should work.
>>
>> verb options arguments
>>
>> That's why we have getopt and that's why I shudder when I see people
>> reinventing wheels.
> 
>>From `man 3 getopt`:
> 
>     "By  default,  getopt()  permutes  the  contents  of argv as it
>     scans, so that eventually all the non-options are at the end."
> 
> So, the default "standard" is to allow mixed options and arguments.
> 

That's why it's so important to do it correctly. Performing consistency
checking is also an important part of the job. For bash programming, I've
actually been using the builtin getopts. If you're in C code, I'd recommend
calling getopt with a + prefixing the first arg.

The main point is that people should design their command lines using POSIX or
SVR4 standards in the first place. Then the decision to use things like getopt
or getopts gets a lot easier.

Take a look at gcc as a classic example of how *not* to do it.

gcc --help # I'm good with that.
gcc -c # Also good. Let's make object code.
gcc -pipe # That's where you lose me. It's just a good thing they don't have a
 -p, -i or a -e option. Or wait! Maybe they can't now.


- --
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkpn8qsACgkQRIVy4fC+NyRDlQCdGp5kdi14O2vsLHkiTlvayFt8
1KIAn2Jiou1JBWxRmB+h3i7+Ydgl9U3t
=O04I
-----END PGP SIGNATURE-----

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux