Beispiel #1
0
        /// <inheritdoc />
        public void Initialize()
        {
            RegisterCommand("sudo", "sudo make me a sandwich", "sudo <command>", (shell, _, args) =>
            {
                string command = args[0];
                var cArgs      = args[1..].Select(CommandParsing.Escape);

                var localShell = shell.ConsoleHost.LocalShell;
                var sudoShell  = new SudoShell(this, localShell, shell);
                ExecuteInShell(sudoShell, $"{command} {string.Join(' ', cArgs)}");
            });