From c6ee0ca66101f88438ff9e4dd8979c5bdfc40912 Mon Sep 17 00:00:00 2001 From: sabetts Date: Thu, 26 Jun 2003 01:47:58 +0000 Subject: (cmd_gmove): prompt the user if no group is passed as an argument. --- src/actions.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index c1e8ac3..d51f326 100644 --- a/src/actions.c +++ b/src/actions.c @@ -3596,21 +3596,26 @@ cmd_groups (int interactive, char *data) char * cmd_gmove (int interactive, char *data) { + char *str; rp_group *g; - if (data == NULL) - { - message (" gmove: one argument required "); - return NULL; - } - if (current_window() == NULL) { message (" gmove: no focused window "); return NULL; } - g = find_group (data); + /* Prompt for a group */ + if (data == NULL) + str = get_input (MESSAGE_PROMPT_SWITCH_TO_GROUP, group_completions); + else + str = xstrdup (data); + + /* User aborted. */ + if (str == NULL) + return NULL; + + g = find_group (str); if (g == NULL) { message (" gmove: cannot find group "); -- cgit v1.2.3