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. --- ChangeLog | 3 +++ src/actions.c | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d078ab8..523d86b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-06-25 Shawn Betts + * src/actions.c (cmd_gmove): prompt the user if no group is passed + as an argument. + * contrib/rpws: call /bin/bash (rp_call): remove extraneous () in function declaration. (ws_init_ws): likewise 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