1 /* gEDA - GPL Electronic Design Automation
2 * gschlas - gEDA Load and Save
3 * Copyright (C) 2002-2010 Ales Hvezda
4 * Copyright (C) 2002-2020 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <libgeda/libgeda.h>
33 #include "../include/globals.h"
34 #include "../include/prototype.h"
36 #define OPTIONS "hqveu"
38 #ifndef OPTARG_IN_UNISTD
47 #ifdef HAVE_GETOPT_LONG
48 struct option long_options
[] =
51 {"unembed", 0, 0, 'u'},
53 {"verbose", 0, 0, 'v'},
60 printf("Usage: %s [OPTIONS] filename1 ... filenameN\n\n", cmd
);
61 printf(" -e, --embed Embed all components/pictures\n");
62 printf(" -u, --unembed Unembed all components/pictures\n");
63 printf(" -q, --quiet Quiet mode\n");
64 printf(" -v, --verbose Verbose mode on\n");
65 printf(" -h, --help This message\n");
70 int parse_commandline(int argc
, char *argv
[])
74 #ifdef HAVE_GETOPT_LONG
75 while ((ch
= getopt_long (argc
, argv
, OPTIONS
, long_options
, NULL
)) != -1) {
77 while ((ch
= getopt(argc
, argv
, OPTIONS
)) != -1) {
109 verbose_mode
= FALSE
;
112 if (embed_mode
&& unembed_mode
) {
114 "Cannot specify both -e and -u at the same time (ignoring both flags)\n");
116 unembed_mode
= FALSE
;