#!/usr/bin/perl -T -I/h/COE/lib -U 

# The -U forces the insecure dependency in /usr/bin/groups
# The -w is dropped to hide the warning

use strict;
use Coe;

my $VERSION="1.1.4.1";
if (@ARGV == 0) {
	&useage;
} 

sub useage { print "Useage: $0 {username}\n"; exit 1; }

my $arg1;
my $flag="false";
my $username="dummy";
my $info;

while (@ARGV > 0 ){
	$arg1=cleanString(shift,1);
	if ("$arg1" eq "-h") {
 		print "Useage: $0 username\n";
   		exit;
	} elsif ("$arg1" eq "-H") {
   		print "HELP\n";
   		exit;
	} elsif ("$arg1" eq "-V") {
   		print "VERSION: $VERSION\n";
   		exit;
	} else {
		$username=$arg1;
	}
}

# --+----|----+----|----+----|----+----|----+----|----+----|----+----|----+----|
# do simple sanity checks
# --+----|----+----|----+----|----+----|----+----|----+----|----+----|----+----|

if ("$username" eq "dummy") { &useage }

# --+----|----+----|----+----|----+----|----+----|----+----|----+----|----+----|
# define some stuff
# --+----|----+----|----+----|----+----|----+----|----+----|----+----|----+----|

$info = coeExec("/usr/bin/groups $username"); 
chomp ($info);
$info = cleanString($info, 3);
print "$info\n";