/* This file is part of GNU Pies. -*- c -*- Copyright (C) 2008-2019 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GNU Pies is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Pies. If not, see . */ OPTIONS_BEGIN("piesctl", [], [], [], [], []) OPTION(instance,i,NAME, []) BEGIN instance = optarg; END OPTION(config-file,c,FILE, []) BEGIN config_file = optarg; END OPTION(config-help,,, []) BEGIN config_help (); exit (0); END OPTION(,E,, []) BEGIN preprocess_only = 1; END OPTION(verbose,v,, []) BEGIN ++verbose; END OPTION(dump,d,, []) BEGIN ++dump; END OPTION(url,u,URL, []) BEGIN if (pies_url_create (&client.url, optarg)) { grecs_error (NULL, 0, _("%s: cannot create URL: %s"), optarg, strerror (errno)); exit (EX_USAGE); } END GROUP(Preprocessor) OPTION(include-directory,I,DIR, []) BEGIN grecs_preproc_add_include_dir (optarg); END OPTION(define,D,[], []) BEGIN pp_add_option ("-D", optarg); END OPTION(undefine,U,NAME, []) BEGIN pp_add_option ("-U", optarg); END OPTIONS_END void parse_options(int argc, char *argv[], int *index) { GETOPT(argc, argv, *index) setenv ("PIES_INSTANCE", instance, 1); }