Merge remote-tracking branch 'incertia/account-remove'

This commit is contained in:
James Booth
2014-11-24 00:38:22 +00:00
4 changed files with 28 additions and 1 deletions

View File

@@ -189,6 +189,19 @@ cmd_account(gchar **args, struct cmd_help_t help)
cons_show("Account created.");
cons_show("");
}
} else if (strcmp(command, "remove") == 0) {
char *account_name = args[1];
if(!account_name) {
cons_show("Usage: %s", help.usage);
} else {
if(accounts_remove(account_name)){
cons_show("Account %s removed.", account_name);
} else {
cons_show("Failed to remove account %s.", account_name);
cons_show("Either the account does not exist, or an unknown error occurred.");
}
cons_show("");
}
} else if (strcmp(command, "enable") == 0) {
char *account_name = args[1];
if (account_name == NULL) {