New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question
] Develop Console Prompt Screen
#2422
Comments
Your attempt with You are using a CommandLineBuilder. To use the built-in help options, call either UseHelp() or UseDefaults() (which itself calls UseHelp) on the CommandLineBuilder before building the parser from it. Your attempt with Note that |
Problem that I am having when I don't use |
Unfortunately, i am unable to follow your explanations :-( You say that "Problem that I am having when I don't use RootCommand It can't not even parse
While i am not 100% certain, i doubt
I see two ways to do it. One way is to let the handler for the help command simply parse and invoke on a bespoke string featuring a help option. If your existing parser instance has these built-in help options activated, you could reuse it, i believe. Otherwise, let the help command create a new parser based off a new CommandLineBuilder that has the built-in help options activated. The other way i see is letting the handler for the Help command do something similar to to what the SCL middleware for the built-in help options is doing: command-line-api/src/System.CommandLine/Help/HelpResult.cs Lines 12 to 23 in 3e0db9e
Don't use UseParseErrorReporting() then, as it printing the help text is unfortunately hard-coded. Instead, inspect the parse result before calling Invoke/Async on it. Specifically look at its |
I am building a custom
console
prompt; however I keep getting error when a command is found or not. As you will see in the image below.How my app works:
I'm running my app as
MyApp.exe connect \\.\pipe\HelloWorld
then screen refreshes to appear as terminal on that computer. This would be my implementation ofIPC
for the program.Now this is the
prompt
(image) its not mypowershell
prompt; even though it looks like it. But still in myterminal
.The text was updated successfully, but these errors were encountered: