Page MenuHomeFreeBSD

Add an example to pw(8) that shows how to add a user to the wheel group
ClosedPublic

Authored by bcr on Feb 8 2019, 6:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 11:08 PM
Unknown Object (File)
Fri, Nov 15, 3:03 AM
Unknown Object (File)
Oct 14 2024, 10:41 AM
Unknown Object (File)
Oct 14 2024, 10:40 AM
Unknown Object (File)
Oct 14 2024, 10:40 AM
Unknown Object (File)
Oct 14 2024, 10:40 AM
Unknown Object (File)
Oct 14 2024, 10:38 AM
Unknown Object (File)
Sep 26 2024, 10:51 PM
Subscribers

Details

Summary

Rather than manually editing /etc/group, we recommend using pw for that operation. But if the man page does not have an example how to add a user to the (popular) wheel group (or any other), it's hard to teach people proper behavior. With this example in the man page, we can just point people at it.

I was not sure whether I should put the example in the middle of the current ones that are there, reusing the gsmith name. If I put it at the end, people might argue that the example above it just deleted the user and so my example would not actually work since the user must exist. Any comments on that?

Checked with igor and mandoc -Tlint

Test Plan
  1. Apply the attached patch to head/usr.sbin/pw/pw.8
  2. man ./head/usr.sbin/pw/pw.8
  3. Scroll to the EXAMPLES section

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

head/usr.sbin/pw/pw.8
986

How about use jsmith instead of foo to address your issue about gsmith being deleted in the prior example.

Use jsmith instead of foo as gsmith was deleted in the example prior to this one.

bcr marked an inline comment as done.Feb 8 2019, 7:00 PM

OK, jsmith it is.

LGTM

Thanks for the patch!

This revision is now accepted and ready to land.Feb 8 2019, 9:07 PM
This revision was automatically updated to reflect the committed changes.