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)
Mar 15 2024, 11:28 PM
Unknown Object (File)
Mar 12 2024, 11:54 PM
Unknown Object (File)
Mar 12 2024, 6:14 AM
Unknown Object (File)
Mar 12 2024, 6:14 AM
Unknown Object (File)
Mar 12 2024, 6:14 AM
Unknown Object (File)
Mar 12 2024, 6:14 AM
Unknown Object (File)
Mar 8 2024, 5:05 AM
Unknown Object (File)
Jan 25 2024, 11:27 AM
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

Lint
Lint Skipped
Unit
Tests Skipped

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.