#include <sys/types.h>
static const char id_usage[] =
- "id [OPTIONS]... [USERNAME]\n\n"
- "Print information for USERNAME or the current user\n\n"
+ "id [OPTIONS]... [USERNAME]\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+ "\nPrint information for USERNAME or the current user\n\n"
+ "Options:\n"
"\t-g\tprints only the group ID\n"
"\t-u\tprints only the user ID\n"
- "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n";
+ "\t-r\tprints the real user ID instead of the effective ID (with -ug)\n\n"
+#endif
+ ;
extern int id_main(int argc, char **argv)
{
int no_user = 0, no_group = 0, print_real = 0;
char *cp, *user, *group;
- gid_t gid;
+ unsigned long gid;
cp = user = group = NULL;
my_getgrgid(group, gid);
}
- if (no_group) printf("%u\n", my_getpwnam(user));
- else if (no_user) printf("%u\n", my_getgrnam(group));
+ if (no_group) printf("%lu\n", my_getpwnam(user));
+ else if (no_user) printf("%lu\n", my_getgrnam(group));
else
- printf("uid=%u(%s) gid=%u(%s)\n",
+ printf("uid=%lu(%s) gid=%lu(%s)\n",
my_getpwnam(user), user, my_getgrnam(group), group);
- exit(0);
+ return(0);
}