various enhancements

This commit is contained in:
tTh 2024-08-29 18:24:01 +02:00
parent 2a8348f0f9
commit d510e56d44

View File

@ -32,21 +32,23 @@ if (foo) {
fimg_destroy(&fimg); fimg_destroy(&fimg);
return -1; return 0;
} }
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
static void help(int k) static void help(int k)
{ {
puts("export to FITS format"); puts("export to FITS format");
puts("\t-p select colorplane : R, G, B"); puts("\t-p select colorplane : R, G, B");
puts("\t default is blue");
puts("\t-v increase verbosity");
fimg_print_version(k); fimg_print_version(k);
} }
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int opt; int opt, foo;
int plane = '?'; int plane = 'b';
while ((opt = getopt(argc, argv, "p:hv")) != -1) { while ((opt = getopt(argc, argv, "p:hv")) != -1) {
switch(opt) { switch(opt) {
@ -62,8 +64,11 @@ if (2 != argc-optind) {
exit(1); exit(1);
} }
export_fimg_plane_as_fits(argv[optind], argv[optind+1], plane); foo = export_fimg_plane_as_fits(argv[optind], argv[optind+1], plane);
if (foo) {
fprintf(stderr, "export_fimg_plane_as_fits --> %d\n", foo);
exit(1);
}
return 0; return 0;
} }
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */