mirror of
git://projects.qi-hardware.com/fped.git
synced 2024-11-22 07:12:27 +02:00
new option -l (lower case L) to list package names
This commit is contained in:
parent
c04bb8f4e8
commit
0acff965b0
5
fped.1
5
fped.1
@ -4,7 +4,7 @@ fped \- Footprint editor
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.TP
|
.TP
|
||||||
.B fped
|
.B fped
|
||||||
[\-1 package] [\-g] [\-k]
|
[\-1 package] [\-g] [\-k] [\-l]
|
||||||
[\-p|\-P [\-K] [\-m] [\-s scale]]
|
[\-p|\-P [\-K] [\-m] [\-s scale]]
|
||||||
[\-T [\-T]] [cpp_option ...] [in_file [out_file]]
|
[\-T [\-T]] [cpp_option ...] [in_file [out_file]]
|
||||||
|
|
||||||
@ -29,6 +29,9 @@ write gnuplot output, then exit
|
|||||||
\fB\-k\fR
|
\fB\-k\fR
|
||||||
write KiCad output, then exit
|
write KiCad output, then exit
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-l\fR
|
||||||
|
list package names, then exit
|
||||||
|
.TP
|
||||||
\fB\-K\fR
|
\fB\-K\fR
|
||||||
show the pad type key (for \fB\-P\fR)
|
show the pad type key (for \fB\-P\fR)
|
||||||
.TP
|
.TP
|
||||||
|
28
fped.c
28
fped.c
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* fped.c - Footprint editor, main function
|
* fped.c - Footprint editor, main function
|
||||||
*
|
*
|
||||||
* Written 2009-2012, 2015 by Werner Almesberger
|
* Written 2009-2012, 2015-2016 by Werner Almesberger
|
||||||
* Copyright 2009-2012, 2015 by Werner Almesberger
|
* Copyright 2009-2012, 2015-2016 by Werner Almesberger
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -79,6 +79,16 @@ void reload(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void list_packages(void)
|
||||||
|
{
|
||||||
|
const struct pkg *pkg;
|
||||||
|
|
||||||
|
for (pkg = pkgs; pkg; pkg = pkg->next)
|
||||||
|
if (pkg->name)
|
||||||
|
printf("%s\n", pkg->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void usage(const char *name)
|
static void usage(const char *name)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
@ -87,6 +97,7 @@ static void usage(const char *name)
|
|||||||
" -g [-1 package]\n"
|
" -g [-1 package]\n"
|
||||||
" write gnuplot output, then exit\n"
|
" write gnuplot output, then exit\n"
|
||||||
" -k write KiCad output, then exit\n"
|
" -k write KiCad output, then exit\n"
|
||||||
|
" -l list package names, then exit\n"
|
||||||
" -p [-m] write Postscript output, then exit\n"
|
" -p [-m] write Postscript output, then exit\n"
|
||||||
" -P [-K] [-m] [-s scale] [-1 package]\n"
|
" -P [-K] [-m] [-s scale] [-1 package]\n"
|
||||||
" write Postscript output (full page), then exit\n"
|
" write Postscript output (full page), then exit\n"
|
||||||
@ -137,7 +148,8 @@ int main(int argc, char **argv)
|
|||||||
batch_ps,
|
batch_ps,
|
||||||
batch_ps_fullpage,
|
batch_ps_fullpage,
|
||||||
batch_gnuplot,
|
batch_gnuplot,
|
||||||
batch_test
|
batch_test,
|
||||||
|
batch_list,
|
||||||
} batch = batch_none;
|
} batch = batch_none;
|
||||||
char *name = *argv;
|
char *name = *argv;
|
||||||
char **fake_argv;
|
char **fake_argv;
|
||||||
@ -149,7 +161,7 @@ int main(int argc, char **argv)
|
|||||||
const char *one = NULL;
|
const char *one = NULL;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "1:gkmps:D:I:KPTU:")) != EOF)
|
while ((c = getopt(argc, argv, "1:gklmps:D:I:KPTU:")) != EOF)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '1':
|
case '1':
|
||||||
one = optarg;
|
one = optarg;
|
||||||
@ -164,6 +176,11 @@ int main(int argc, char **argv)
|
|||||||
usage(*argv);
|
usage(*argv);
|
||||||
batch = batch_kicad;
|
batch = batch_kicad;
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
if (batch)
|
||||||
|
usage(*argv);
|
||||||
|
batch = batch_list;
|
||||||
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
postscript_params.show_meas = 0;
|
postscript_params.show_meas = 0;
|
||||||
break;
|
break;
|
||||||
@ -265,6 +282,9 @@ int main(int argc, char **argv)
|
|||||||
if (test_mode > 1)
|
if (test_mode > 1)
|
||||||
dump(stdout, NULL);
|
dump(stdout, NULL);
|
||||||
break;
|
break;
|
||||||
|
case batch_list:
|
||||||
|
list_packages();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user