views:

24

answers:

2

Hi

I'm using Visual Studio C# Express 2010 to make a console application. I've implemented the 'commands' as if sections in the Prompt method calling a command method, eg

if (line == "help")
            {
                Help();
            }

That gives you a help page on my program. If it needs cleaning up that's fine.

What I'm trying to figure out is how I can, say, have the user type in a command followed by ? and get command-specific help, rather than just a blanket help page. I don't have any code attempts because I deleted them earlier, but I'll keep coding.

Cheers for your help.

+1  A: 

Here is an article detailing a fairly fully functional Command Line Parser in C#.

It demonstrates how to parse complex command lines following the "standard" techniques of specifying information on a command line.

Reed Copsey
Cheers Reed, I'll take a look at it. Thanks
anubis221
Bonus: The coder's from my home country
anubis221
A: 
 `if (line.indexof("?") != -1) Help()`
rerun