This isn't a trivial task. Basically VxWorks is doing several things for you:
1 - Handling all STDIN functions via the console.
2 - Parsing STDIN text.
3 - Performing a lookup to find a corresponding task with the command name given from the console.
4 - Calling the task (function).
5 - Sending any standard output from the task to the console.
That being said, you'd have to write something that does the same thing.
Now there is truly only one existing example I could think to point you to. The InterNiche TCP/IP stack bundled with the NIOS tools has support for something similar. It doesn't do quite as much for you as VxWorks. Basically it supports the concept of menus. You can create menus which basically consist of titles and callback functions. The console driver provided in the InterNiche stack will parse the console input and call your specified callback function should it be called along with any arguments you've provided. Your function can then use a special "nsprintf" function to print text to the console.
This console is available either from the STDIN, STDOUT streams or via the Telnet console if you've connected to the board via Telnet.
Jake