I'm sorry to say this, but I think you need a bit more learning. You must have patience. Maybe you think you've wasted a day, but if you were working on solving this problem, you must have learnt something, even if it is how NOT to do things: next time you won't do that again, so you'll save time.
So back to your problem. First put into the main section the code you want to use to check the arguments. If there isn't any, write out that you'll use teh working directory. If there is one, then write it's value out. If there are more than one, then write out that only one directory must be specified.
It will be a good start. I think there will be people who will guide you through this. I believe that the links I've posted so long hold 80% of the code required for your project, you just have to modify them slightly.
None of them is longer than a couple of lines, but you have to know the function of every line, otherwise, you won't be able to use them. If you don't understand them after looking up the functions in the API specification then don't be afraid to read a basic tutorial, it would take only one or 2 hours, but many things will make sense.
Command Line Parsing/Arguments
I would like some help with command line parsing i need to be able to
15 Replies - 2198 Views - Last Post: 08 August 2007 - 08:44 AM