]> the.earth.li Git - onak.git/commitdiff
Obey binary flag for "onak get"
authorJonathan McDowell <noodles@earth.li>
Tue, 2 Jun 2009 10:43:37 +0000 (11:43 +0100)
committerJonathan McDowell <noodles@earth.li>
Tue, 2 Jun 2009 10:43:37 +0000 (11:43 +0100)
  We accepted -b for "onak add" to read in a binary key, but always
  output keys ASCII armoured; obey -b for get as well and return the
  raw key data.

onak.c

diff --git a/onak.c b/onak.c
index 3a6f62fad122af9e8103ce87eaab04d60c4610b1..30f771084931b3ee249f8d2e497d2d0edff89b55 100644 (file)
--- a/onak.c
+++ b/onak.c
@@ -322,9 +322,15 @@ int main(int argc, char *argv[])
                                                &packets,
                                                &list_end);
                                free_publickey(keys);
-                               armor_openpgp_stream(stdout_putchar,
+                               if (binary) {
+                                       write_openpgp_stream(stdout_putchar,
                                                NULL,
                                                packets);
+                               } else {
+                                       armor_openpgp_stream(stdout_putchar,
+                                               NULL,
+                                               packets);
+                               }
                                free_packet_list(packets);
                                packets = NULL;
                        } else {