diff options
author | James Booth <boothj5@gmail.com> | 2014-11-24 00:38:22 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-11-24 00:38:22 +0000 |
commit | 679513ae7318f7cb41e710188d042cbce3d65401 (patch) | |
tree | e13869772fe7de67f860dccda3ad085987fd0365 /src/command/commands.c | |
parent | d1c5cfefb6114a759fd05723802db0fa7c838f5d (diff) | |
parent | be031bbe5407edae923b7e2c28e757ffcb9b5052 (diff) | |
download | profani-tty-679513ae7318f7cb41e710188d042cbce3d65401.tar.gz |
Merge remote-tracking branch 'incertia/account-remove'
Diffstat (limited to 'src/command/commands.c')
-rw-r--r-- | src/command/commands.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 429da888..081c8f10 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) { |