Created attachment 175028 [details] patch to add -d flag to hostname Hello, Here is a patch to add -d flag to hostname command. -d prints domain only. # hostname server.domain.com # hostname -s server # hostname -d domain.com Thank you for merging ! Ben
testbuild is OK. I'm wondering if the command should warn/error if one uses any combination of flags on the command line and what should take precedence ?
Created attachment 175863 [details] patch to add -d flag to hostname
I've just modified the patch according to your last comment Kurt.
Created attachment 175866 [details] patch to add -d flag to hostname
I'll take it.
Many thanks Marcelo, should then be merged soon :)
A commit references this bug: Author: araujo Date: Tue Nov 8 11:36:33 UTC 2016 New revision: 308443 URL: https://svnweb.freebsd.org/changeset/base/308443 Log: Add -d flag that prints domain only. PR: 212875 Submitted by: Ben RUBSON <ben.rubson@gmail.com> Reviewed by: pi Changes: head/bin/hostname/hostname.1 head/bin/hostname/hostname.c
Thank you guys, for the patch and review.
A commit references this bug: Author: araujo Date: Fri Nov 25 05:54:18 UTC 2016 New revision: 309130 URL: https://svnweb.freebsd.org/changeset/base/309130 Log: MFC r308443, r308459, r308462, r308478, r308786 r308443: Add -d flag that prints domain only. PR: 212875 Submitted by: Ben RUBSON <ben.rubson@gmail.com> Reviewed by: pi r308459: Fix missing '-' for the flags -s and -d on both manpage and usage. Reported by: garga, bde r308462: Add flag -B which does the same like batch mode but without exiting after print. Also add a new flag -s that add blocks size to statistics. PR: 198347, 212726 Submitted by: Ben RUBSON <ben.rubson@gmail.com> Tested by: pi MFC After: 2 weeks. r308478: We can't use protect(1) inside a jail(8)! To avoid have warning for services that are using oomprotect, oomprotect will only be applied on services that won't run inside jails. Reported by: allanjude MFC after: 2 weeks. r308786: rc.subr: Swap checks so we only fork sysctl if *_oomprotect is set. Changes: _U stable/11/ stable/11/bin/hostname/hostname.1 stable/11/bin/hostname/hostname.c stable/11/etc/rc.subr stable/11/usr.sbin/gstat/gstat.8 stable/11/usr.sbin/gstat/gstat.c