summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-09-14 23:06:52 +0200
committerDaniel Friesel <derf@finalrewind.org>2010-09-14 23:06:52 +0200
commit09fd4a99df2a0a791677d48a936244630bbfee33 (patch)
tree90531ccbcc463bd0b3b8f5f13d0350b5bfe46763 /src/options.c
parentdabc31d51f10436cf66dc2f1aeeabe45c684d327 (diff)
Remove --action-hold-slide, add per-action method instead.
When executing an action starting with a semicolon, feh will not skip to the next slide. The semicolon is not passed on to the executing shell, of course. This is kinda ugly, but at least it makes action handling somewhat more flexible.
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/options.c b/src/options.c
index 182f3d8..2206f3e 100644
--- a/src/options.c
+++ b/src/options.c
@@ -71,7 +71,6 @@ void init_parse_options(int argc, char **argv)
opt.next_button = 5;
opt.draw_actions = 0;
- opt.action_hold_slide = 0;
opt.rotate_button = 2;
opt.no_rotate_ctrl_mask = 0;
@@ -422,12 +421,12 @@ static void feh_parse_option_array(int argc, char **argv)
{"index-size" , 1, 0, 231},
{"index-dim" , 1, 0, 232},
{"thumb-redraw" , 1, 0, 'J'},
- {"action-hold-slide", 0, 0, 233},
{"info" , 1, 0, 234},
{0, 0, 0, 0}
};
int optch = 0, cmdx = 0;
+ int i = 0;
/* Now to pass some optionarinos */
while ((optch = getopt_long(argc, argv, stropts, lopts, &cmdx)) != EOF) {
@@ -770,9 +769,6 @@ static void feh_parse_option_array(int argc, char **argv)
case 'J':
opt.thumb_redraw = atoi(optarg);
break;
- case 233:
- opt.action_hold_slide = 1;
- break;
case 234:
opt.info_cmd = estrdup(optarg);
break;
@@ -790,6 +786,13 @@ static void feh_parse_option_array(int argc, char **argv)
}
}
+ for (i = 0; i < 10; i++) {
+ if (opt.actions[i] && !opt.hold_actions[i] && (opt.actions[i][0] == ';')) {
+ opt.hold_actions[i] = 1;
+ opt.actions[i] = &opt.actions[i][1];
+ }
+ }
+
/* So that we can safely be called again */
optind = 1;
return;