static GtkWidget *win, *hbox1, *vbox1, *timebox, *namebox, *togglebutton1;
static time_t alarm_time;
static char *run_cmd;
+static char *default_name = "Tea";
static int expired;
static void
namebox = gtk_entry_new_with_max_length(30);
gtk_widget_show(namebox);
gtk_box_pack_start(GTK_BOX(vbox1), namebox, TRUE, TRUE, 0);
- gtk_entry_set_text(GTK_ENTRY(namebox), "Tea");
+ gtk_entry_set_text(GTK_ENTRY(namebox), default_name);
timebox = gtk_entry_new_with_max_length(9);
gtk_widget_show(timebox);
gtk_widget_show(win);
}
-static const char short_opts[] = "r:";
+static const char short_opts[] = "r:n:";
static const struct option long_opts[] = {
{ "run", required_argument, NULL, 'r' },
+ { "timer-name", required_argument, NULL, 'n' },
{ NULL, 0, NULL, 0 },
};
-r, --run=<cmd>\t\tRun a given program when the tea is ready\n\
\t\t\t\t%%d will be expanded to timer name\n\
\t\t\t\t%%%% will be expanded to %%\n\
+-n, --timer-name=<str>\tFill name box with <str>\n\
");
exit(1);
}
case 'r':
run_cmd = optarg;
break;
+ case 'n':
+ default_name = optarg;
+ break;
default:
usage();
}