1 /* gEDA - GPL Electronic Design Automation
2 * gattrib -- gEDA component and net attribute manipulation using spreadsheet.
3 * Copyright (C) 2003-2007 Stuart D. Brorson.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
33 #endif /* Checking for getopt */
35 #if !defined(HAVE_GETOPT_LONG) || !defined(HAVE_GETOPT_H)
37 #ifndef OPTARG_IN_UNISTD
41 #endif /* Checking for getopt_long */
44 #ifdef HAVE_LIBDMALLOC
49 /*------------------------------------------------------------------
50 * Gattrib specific includes
51 *------------------------------------------------------------------*/
52 #include <libgeda/libgeda.h> /* geda library fcns */
53 #include "../include/struct.h" /* typdef and struct declarations */
54 #include "../include/prototype.h" /* function prototypes */
55 #include "../include/globals.h"
61 printf("Gattrib: The gEDA project\'s attribute editor.\n");
62 printf("Presents schematic attributes in easy-to-edit spreadsheet format.\n");
64 printf("Usage: %s [OPTIONS] filename1 ... filenameN\n", cmd
);
65 printf(" -q, --quiet Quiet mode\n");
66 printf(" -v, --verbose Verbose mode on\n");
67 printf(" -h, --help This help menu\n");
70 printf(" * What do the colors of the cell text mean?\n");
71 printf(" The cell colors indicate the visibility of the attribute.\n");
72 printf(" Black = Visible attribute, value displayed only.\n");
73 printf(" Grey = Invisible attribute.\n");
74 printf(" Red = Visible attribute, name displayed only.\n");
75 printf(" Blue = Visible attribute, both name and value displayed.\n");
77 printf(" * What does the period (\".\") at the end of some component refdeses mean?\n");
78 printf(" The period is placed after the refdeses of slotted components.\n");
79 printf(" If slots are present on the component, then the different slots appear\n");
80 printf(" in different rows with the slot number after the period. Example: C101.2.\n");
82 printf("Copyright (C) 2003 -- 2006 Stuart D. Brorson. E-mail: sdb (AT) cloud9 (DOT) net.\n");
88 int parse_commandline(int argc
, char *argv
[])
92 #if defined(HAVE_GETOPT_LONG) && defined(HAVE_GETOPT_H)
93 /* Use getopt_long if it is available */
95 static struct option long_options
[] = {
98 {"verbose", 0, 0, 'v'},
103 ch
= getopt_long(argc
, argv
, "hqv", long_options
, &option_index
);
107 /* Otherwise just use regular getopt */
108 while ((ch
= getopt(argc
, argv
, OPTIONS
)) != -1) {
133 verbose_mode
= FALSE
;