Skip to content
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

Request for exit conditions #5

Open
BillSobel opened this issue Oct 25, 2019 · 1 comment
Open

Request for exit conditions #5

BillSobel opened this issue Oct 25, 2019 · 1 comment

Comments

@BillSobel
Copy link

Would it be possible for the call to exit the Run loop (Environment.Exit(0)) today to instead be a lamda. Im my case I ideally do not want the process to exit, just exit the command shell. On the same vane, could the Run lamda have a way to indicate that the run loop should exit so exit/quit etc commands can be implemented in addition to the escape key?

@BillSobel
Copy link
Author

Proposed changes:

                    if (lastKey.Key == ConsoleKey.Escape)
                        return; // Environment.Exit(0);

            var result = lambda(cmd, input, completionList);
            if (result.Output != null) Console.Write(result.Output);
            if (result.Continue == false) return;

With the processing lamda returning (bool Continue, string Output) vs just the string it does today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant