id: support multiple specified users
commita32a756a58fec134836f85c2c8bfd58063ebc4c4
authorAchilles Gaikwad <agaikwad@redhat.com>
Mon, 23 Jul 2018 19:39:13 +0000 (24 01:09 +0530)
committerPádraig Brady <P@draigBrady.com>
Sun, 30 Sep 2018 05:39:26 +0000 (29 22:39 -0700)
tree357b404839dd1cb0b9953a0ca0f89021f51221a2
parent7262994810deac63fcb55223e599acc7339a7526
id: support multiple specified users

  $ id root nobody
  uid=0(root) gid=0(root) groups=0(root)
  uid=99(nobody) gid=99(nobody) groups=99(nobody)

* src/id.c (main): Make variables opt_zero, just_group_list,
just_group, use_real, just_user global to be used in a new
function.
(print_stuff): New function that will print user and group
information for the specified USER.
When using -G option delimit each record with two NULs.
Restructure the code in the file to have global variables
followed by functions.
* tests/id/zero.sh: Add test cases to check the usage
of -z option with multiple users.
* tests/id/uid.sh: Add a test case to ensure all users
are queried in the presence of errors.
* doc/coreutils.texi: Document the interface changes.
* NEWS: Mention the new feature.
NEWS
doc/coreutils.texi
src/id.c
tests/id/uid.sh
tests/id/zero.sh