summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-10-05 17:36:33 +0000
committersabetts <sabetts>2004-10-05 17:36:33 +0000
commitd4cb2a0028d6a3ac5fe608e415eb4d40b91dc1dd (patch)
tree0bc698e190381fed640478750187a3228d924ee1 /src
parenta2e124626484dac451d0fbea47de11834a5add7f (diff)
downloadratpoison-d4cb2a0028d6a3ac5fe608e415eb4d40b91dc1dd.zip
(cmd_version): add the build date and time.
(cmd_fselect): in interactive mode, return 'abort' when the user aborts, the frame number when they select one, or 'No such frame' when they selected a nonexistent one. (cmd_version): return the version string in non-interactive mode.
Diffstat (limited to 'src')
-rw-r--r--src/actions.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/actions.c b/src/actions.c
index 3278374..84ba3b5 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1095,8 +1095,15 @@ cmd_kill (int interactive, char *data)
char *
cmd_version (int interactive, char *data)
{
- message (" " PACKAGE " " VERSION " ");
- return NULL;
+ if (interactive)
+ {
+ message (" " PACKAGE " " VERSION " (built " __DATE__ " " __TIME__ ") ");
+ return NULL;
+ }
+ else
+ {
+ return strdup (PACKAGE " " VERSION " (built " __DATE__ " " __TIME__ ")");
+ }
}
char *
@@ -3462,11 +3469,11 @@ cmd_fselect (int interactive, char *data)
{
fnum = frame_selector_match (keysym_buf[0]);
if (fnum == -1)
- return NULL;
+ return xstrdup ("abort");
}
else
{
- return NULL;
+ return xstrdup ("abort");
}
}
@@ -3474,11 +3481,24 @@ cmd_fselect (int interactive, char *data)
it. */
frame = find_frame_number (fnum);
if (frame)
- set_active_frame (frame);
- else
- marked_message_printf (0, 0, " fselect: No such frame (%d) ", fnum);
+ {
+ char *s;
+ struct sbuf *sb;
- return NULL;
+ /* Return the frame number that was selected. */
+ sb = sbuf_new(0);
+ sbuf_printf (sb, "%d", fnum);
+ s = sbuf_get(sb);
+ free (sb);
+
+ set_active_frame (frame);
+ return s;
+ }
+ else
+ {
+ marked_message_printf (0, 0, " fselect: No such frame (%d) ", fnum);
+ return xstrdup ("No such frame");
+ }
}
char *