your main should be desinged as
int main(int argc, char** argv)
If you put command line arguments on the command line, argc will be greater then one and all command line arguments will be in argv[1 thru argc-1]
If you are only passing the directory, all you need to worry about is argv[1]
Matt