Subversion Repositories HomeAutomation

Rev

Rev 1660 | Rev 1673 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1660 Rev 1664
Line 170... Line 170...
170
    }
170
    }
171
   
171
   
172
    return result;
172
    return result;
173
}
173
}
174
 
174
 
175
function help(command_name)
175
function quit()
176
{
176
{
177
    if (!command_name)
-
 
178
    {
-
 
179
        command_name = "help";
-
 
180
    }
-
 
181
   
-
 
182
    if (Console_Functions[command_name] && Console_Functions[command_name]["help"])
-
 
183
    {
-
 
184
        var result = "";
-
 
185
       
-
 
186
        if (Console_Functions[command_name] && Console_Functions[command_name]["autocomplete"])
-
 
187
        {
-
 
188
            result += "Argument autocompletion enabled for " + command_name + "\n";
-
 
189
        }
-
 
190
       
-
 
191
        result += "Syntax: " + command_name + " " + Console_Functions[command_name]["help"] + "\n";
-
 
192
       
-
 
193
        Log(result);
177
    Log("Goodbye!\n");
194
        return true;
-
 
195
    }
-
 
196
   
178
   
197
    Log("\033[31mNo help for " + command_name + " found.\033[0m\n");
179
    ConsoleExport_DisconnectClient(Console_LastClientId);
-
 
180
    Console_LastClientId = null;
198
    return false;
181
    return false;
199
}
182
}
200
Console_RegisterCommand(help, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Console_GetFunctionNames()); });
183
Console_RegisterCommand(quit);