Ejemplo n.º 1
0
    public void Shell(string[] args)
    {
        NetworkDevice device = TerminalNetwork.GetCurrentDevice();

        if (device == null)
        {
            return;
        }

        if (args.Length == 0)
        {
            TerminalCore.AddMessage("<color=#0087ff> Shell <cmd>:</color>");

            foreach (string cmd in device.GetCommands())
            {
                TerminalCore.AddMessage("\t-" + cmd);
            }
        }
        else
        {
            string inputString = args[0];
            for (int i = 1; i < args.Length; i++)
            {
                inputString += " " + args[i];
            }

            Command command = device.GetCommand(TerminalLogic.FindKeyword(inputString));
            if (command != null)
            {
                TerminalCore.AddLoadingBar(0.4f, null, "\n\tSending Command.", "\n\tCommand Recieved");

                Shell(inputString);
            }
            else
            {
                PrintUsage();
            }
        }
    }