From be031bbe5407edae923b7e2c28e757ffcb9b5052 Mon Sep 17 00:00:00 2001 From: Will Song Date: Sun, 23 Nov 2014 15:37:10 -0600 Subject: implement account removal --- src/command/commands.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/command/commands.c') diff --git a/src/command/commands.c b/src/command/commands.c index ad1ef1a9..5fea0681 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -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) { -- cgit 1.4.1-2-gfad0