diff options
author | sabetts <sabetts> | 2003-06-26 01:47:58 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-06-26 01:47:58 +0000 |
commit | c6ee0ca66101f88438ff9e4dd8979c5bdfc40912 (patch) | |
tree | d15e767d739ac44f7a93147db9d40c654bcf501c | |
parent | 4724ed633da36b1316164c340e63973ec13c0a8c (diff) | |
download | ratpoison-c6ee0ca66101f88438ff9e4dd8979c5bdfc40912.zip |
(cmd_gmove): prompt the user if no group is passed
as an argument.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/actions.c | 19 |
2 files changed, 15 insertions, 7 deletions
@@ -1,5 +1,8 @@ 2003-06-25 Shawn Betts <sabetts@sfu.ca> + * 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 "); |