about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-05-16 23:47:33 +0100
committerJames Booth <boothj5@gmail.com>2013-05-16 23:47:33 +0100
commitaa1f8b655c7d88e249962ae98e08dc9468c2e7bc (patch)
treeae9375b22d33d2e5272370344a893b44f8102297 /src/command
parent5a3db018dcfba42ec5a194b36a655905808d0144 (diff)
downloadprofani-tty-aa1f8b655c7d88e249962ae98e08dc9468c2e7bc.tar.gz
Show how many windows closed with /close all and /close read
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/command/command.c b/src/command/command.c
index 90e5138b..62d81626 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -2514,6 +2514,7 @@ _cmd_close(gchar **args, struct cmd_help_t help)
     jabber_conn_status_t conn_status = jabber_get_connection_status();
     int index = 0;
     int curr = 0;
+    int count = 0;
 
     if (args[0] == NULL) {
         index = ui_current_win_index();
@@ -2524,10 +2525,16 @@ _cmd_close(gchar **args, struct cmd_help_t help)
                     _close_connected_win(curr);
                 }
                 ui_close_win(curr);
+                count++;
             }
         }
-
-        cons_show("Closed all windows.");
+        if (count == 0) {
+            cons_show("No windows to close.");
+        } else if (count == 1) {
+            cons_show("Closed 1 window.");
+        } else {
+            cons_show("Closed %d windows.", count);
+        }
         return TRUE;
     } else if (strcmp(args[0], "read") == 0) {
         for (curr = 1; curr <= 9; curr++) {
@@ -2536,9 +2543,16 @@ _cmd_close(gchar **args, struct cmd_help_t help)
                     _close_connected_win(curr);
                 }
                 ui_close_win(curr);
+                count++;
             }
         }
-        cons_show("Closed windows.");
+        if (count == 0) {
+            cons_show("No windows to close.");
+        } else if (count == 1) {
+            cons_show("Closed 1 window.");
+        } else {
+            cons_show("Closed %d windows.", count);
+        }
         return TRUE;
     } else {
         index = atoi(args[0]);