| | 1 | | using CommandLine; |
| | 2 | | using Mklinker.Abstractions; |
| | 3 | |
|
| | 4 | | namespace Mklinker.Commands { |
| | 5 | |
|
| | 6 | | [Verb("interactive", HelpText = "Starts an interactive session where you can run multiple commands without 'Mklinker' |
| | 7 | | class InteractiveCommand { |
| | 8 | |
|
| 2 | 9 | | internal void Execute(IConsole console, IArgumentParser argumentHandler, ICommandExecutor commandExecutor) { |
| 2 | 10 | | bool finished = false; |
| | 11 | |
|
| 8 | 12 | | while (!finished) { |
| 3 | 13 | | console.Write("> "); |
| 3 | 14 | | string input = console.ReadLine().Trim(); |
| | 15 | |
|
| 5 | 16 | | if (input.ToLower().Equals("exit")) { |
| 2 | 17 | | finished = true; |
| 3 | 18 | | } else { |
| 1 | 19 | | commandExecutor.Execute(argumentHandler.ParseStringToArguments(input)); |
| 1 | 20 | | } |
| 3 | 21 | | } |
| 2 | 22 | | } |
| | 23 | |
|
| | 24 | | } |
| | 25 | |
|
| | 26 | | } |