From 2a0d241f69f7f3f5b826656a97f9bafb20bd8711 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Sat, 21 Sep 2013 14:15:45 +0200 Subject: id: add -z, --zero option * src/group-list.h (print_group_list): Add a parameter for the delimiter of type char. * src/group-list.c (print_group_list): Likewise, and use it instead of a white space character to delimit the group entries. * src/groups.c (main): Pass white space character to print_group_list(). * src/id.c (longopts): Add array element for the new long option. (usage): Document the new option. While at it, fix the alignment of the descriptions to match that of HELP_OPTION_DESCRIPTION. (main): Define the bool flag opt_zero indicating the use of the new option. In the getopt_long loop, handle it. Output an error diagnostic in the case the --zero option has been specified together with the default format. In the case of -gG, pass either a NUL or a white space character to print_group_list() - depending on the above new flag. Likewise change the printing of the final newline character: output a NUL instead if the --zero option has been specified. * doc/coreutils.texi (id invocation): Document the new option. While at it, move the @exitstatus macro down after the macro @primaryAndSupplementaryGroups in order to be consistent with other texinfo documents. (groups invocation): Move @exitstatus down after the macro @primaryAndSupplementaryGroups here, too. * tests/misc/id-zero.sh: Add new test exercising the new option. * tests/local.mk (all_tests): Reference it. * NEWS (New features): Mention the new option. Fixes http://bugs.gnu.org/9987 --- NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index d26722ddf..23c7b54fd 100644 --- a/NEWS +++ b/NEWS @@ -44,6 +44,9 @@ GNU coreutils NEWS -*- outline -*- du accepts a new option: --inodes to show the number of inodes instead of the blocks used. + id accepts a new option: --zero (-z) to delimit the output entries by + a NUL instead of a white space character. + id and ls with -Z report the SMACK security context where available. mkdir, mkfifo and mknod with -Z set the SMACK context where available. -- cgit v1.2.3-70-g09d2