I am developing console application in C# with lot of parameters and sometime I as developer can't remember combination of parameters to call application in right way, I can't even and think how users will do it. So I asking You is there and what will be the proper (scholastic) way to make my application act like those UNIX OS. You know what I trying to accomplish is that when user call application and after that when hit a TAB then get list of possible commands, after choice one of command again hit a tab and get referent list of parameters and other commands.
I think the easiest way to do this is to use the Console.ReadKey method. This will allow you to get the tab key as soon as it's pressed by the user. You can then handle that keystroke and if it's a tab, determine the current context and print out the commands as appropriate.
Develop your application as a PowerShell CmdLet. Powershell already has tab-completion infrastructure built-in. For example, if you do the following for the dir CmdLet:
dir -Tab
then hitting Tab repeatedly will cycle through the possible options for the dir command:
Etcetera.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With