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.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bcr created this revision.Feb 8 2019, 6:23 PM
rgrimes added inline comments.Feb 8 2019, 6:34 PM
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.

bcr updated this revision to Diff 53701.Feb 8 2019, 6:58 PM

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.

0mp accepted this revision.Feb 8 2019, 9:07 PM

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.