Make c # win console application to show posibile command when user hit TAB

I am developing a console application in C # with a lot of parameters, and once I, since the developer cannot remember the combination of parameters to correctly call the application, I can’t even think how users will do it. So I ask you if you have and what will be the right (scholastic) way to get my application to act like this UNIX OS. You know what I'm trying to execute is that when the user calls the application, and after that, when he gets to TAB, you get a list of possible commands, after selecting one of the commands goes to the tab again and gets a list of parameter references and other commands .

+3
source share
3 answers

Design your application as PowerShell CmdLet . Powershell already has a bookmarked integration infrastructure in place. For example, if you follow these steps for the CmdLet directory:

dir - Tab

then pressing Tabwill be repeated through the possible command parameters dir:

  • dir -Path
  • dir -LiteralPath
  • dir-filter
  • dir -Include

Etcetera.

+2
source

, - Console.ReadKey. , . , , .

+3

, zsh (Z shell).

, , ; , , .

zsh Windows, Cygwin, , .

Otherwise, I think that your only option is to start some kind of interactive session after starting the program; for example, print all the parameters when the program starts and wait for the user to enter one of the parameters, and then show all possible combinations of parameters.

0
source

Source: https://habr.com/ru/post/1724308/


All Articles