Lines Matching refs:options
36 struct options {
181 printf("Usage: %s [options]\n", cmd);
195 static int options_init(int argc, char *argv[], struct options *options)
212 strftime(options->postfix, sizeof(options->postfix),
225 options->config = optarg;
228 options->duration = atoi(optarg) * 1000;
231 options->loglvl = log_str2level(optarg);
237 strcpy(options->postfix, optarg);
240 strcpy(options->output, optarg);
243 options->logopt = TO_SYSLOG;
246 options->overwrite = 1;
357 struct options *options)
366 if (access(options->output, F_OK) && mkdir(options->output, 0700)) {
367 ERROR("Failed to create directory '%s'\n", options->output);
373 asprintf(&path, "%s/%s%s", options->output,
374 thermometer->tz[i].name, options->postfix);
376 if (!options->overwrite && !access(path, F_OK)) {
461 static int thermometer_wait(struct options *options, pid_t pid)
471 if (options->duration) {
474 timer_it.it_value = msec_to_timespec(options->duration);
535 struct options options = {
545 if (options_init(argc, argv, &options))
548 if (log_init(options.loglvl, argv[0], options.logopt))
551 if (configuration_init(options.config, &config))
560 if (thermometer_start(&thermometer, &options))
566 if (thermometer_wait(&options, pid))