aboutsummaryrefslogtreecommitdiff
path: root/src/cs2cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cs2cs.c')
-rw-r--r--src/cs2cs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cs2cs.c b/src/cs2cs.c
index 167eafa3..76c47403 100644
--- a/src/cs2cs.c
+++ b/src/cs2cs.c
@@ -49,9 +49,10 @@ echoin = 0, /* echo input data to output line */
tag = '#'; /* beginning of line tag character */
static char
*oform = (char *)0, /* output format for x-y or decimal degrees */
+ oform_buffer[16], /* buffer for oform when using -d */
*oterr = "*\t*", /* output line for unprojectable input */
*usage =
-"%s\nusage: %s [ -eEfIlrstvwW [args] ] [ +opts[=arg] ]\n"
+"%s\nusage: %s [ -dDeEfIlrstvwW [args] ] [ +opts[=arg] ]\n"
" [+to [+opts[=arg] [ files ]\n";
static double (*informat)(const char *,
@@ -293,10 +294,15 @@ int main(int argc, char **argv)
case 's': /* reverse output */
reverseout = 1;
continue;
- case 'd': /* set debug level */
+ case 'D': /* set debug level */
if (--argc <= 0) goto noargument;
pj_ctx_set_debug( pj_get_default_ctx(), atoi(*++argv));
continue;
+ case 'd':
+ if (--argc <= 0) goto noargument;
+ sprintf(oform_buffer, "%%.%df", atoi(*++argv));
+ oform = oform_buffer;
+ break;
default:
emess(1, "invalid option: -%c",*arg);
break;