#include <iostream>
#include <my++/auth.h>

using namespace std;

int main (int argc, char **argv) {
	if (argc < 2) {
		cout << "Usage: userinfo [ user_name ]" << endl;
		return 1;
	}

	my::auth::userinfo ui (argv[1]);

	if (!ui.valid()) {
		cout << "User does not exist." << endl;
		return 2;
	}

	cout << "User name: " << ui.name() << endl;
	cout << "User UID : " << ui.uid() << endl;
	cout << "User GID : " << ui.gid() << endl;
	cout << "User Home: " << ui.home() << endl;
	cout << "User Shell: " << ui.shell() << endl;
	cout << "User Gecos: " << ui.gecos() << endl;

	return 0;
}
