While converting a user provisioning tool from use in linux to FreeBSD it turned out crontab -r was interactive (requiring 'y' to remove). This diff adds a '-f' option to force crontab to be non-interactive.
Details
- Reviewers
cem - Group Reviewers
manpages - Commits
- rS310329: Add a 'force' option for non-interactive crontab removal
Tested by adding a test user, creating a crontab for them and attempting to remove it with a without '-f' set.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Please upload a diff with full context (either use the arc tool, or generate a patch with diff -U9999999).
usr.sbin/cron/crontab/crontab.c | ||
---|---|---|
66 ↗ | (On Diff #22971) | Spacing between 'int' and 'fflag' looks off relative to other variables nearby. |
Do you have a commit bit, or do you need me to commit this for you? Thanks!
usr.sbin/cron/crontab/crontab.1 | ||
---|---|---|
20 ↗ | (On Diff #22980) | In general, bump .Dd to the date you changed the manual page. |
usr.sbin/cron/crontab/crontab.c | ||
289 ↗ | (On Diff #22980) | I see. You could also workaround this by running crontab ... < /dev/null. I still like your -f flag, though. |
Fixed date in manpage and no I don't have a bit -- if you could commit that would be great.
usr.sbin/cron/crontab/crontab.1 | ||
---|---|---|
35 ↗ | (On Diff #23003) | This implies that -f is used instead of one of the other arguments. I suggest { .Fl l | .Fl r Op Fl f | .Fl e } |
101 ↗ | (On Diff #23003) | This should probably not be a separate item, since it is only used with -r. Add .Fl f to force the removal without a prompt for confirmation. |
usr.sbin/cron/crontab/crontab.c | ||
---|---|---|
289 ↗ | (On Diff #22980) | Yeah we were piping in yes but it wasn't until I got into the code I saw there was some way to make it non-interactive, but it's undocumented. |