예제 #1
0
    public override bool AutoComplete(out string correction, ParsedCommand parsedCommand)
    {
        correction = "";
        if (!parsedCommand.PopArgument(out string input))
        {
            return(false);
        }
        PublicKey key = HostHandler.I.currentHost.GetComponent <SshKey>();

        if (key == null)
        {
            return(false);
        }
        if (!key.isAvailable)
        {
            return(false);
        }
        if (!key.GetName().StartsWith(input))
        {
            return(false);
        }
        parsedCommand.arguments.Add(key.GetName());
        correction = parsedCommand.GetCommandString();
        return(true);
    }
예제 #2
0
    protected bool ArgumentIsUserHostPair(string argument)
    {
        PublicKey key = HostHandler.I.currentHost.GetComponent <SshKey>();

        if (key.GetName() != argument)
        {
            return(false);
        }
        if (!key.isAvailable)
        {
            return(false);
        }
        return(true);
    }