From d04b51f223a61a8fe9faef6edeb338830d8ef949 Mon Sep 17 00:00:00 2001
From: Heather Schovanec <hschovanec@usgs.gov>
Date: Mon, 5 Mar 2018 12:00:52 -0700
Subject: [PATCH] Add json output to CLI and update docs

---
 docs/io.md             | 7 +++++--
 geomagio/Controller.py | 4 ++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/io.md b/docs/io.md
index 7933877dc..95f9e66a5 100644
--- a/docs/io.md
+++ b/docs/io.md
@@ -53,7 +53,7 @@ Interval specifies the amount of data in each url and defaults to 1 day.
 
 ### Output Format
 
-`--output {binlog, edge, iaga2002, pcdcp, plot, temperature, vbf}`
+`--output {binlog, edge, iaga2002, imfjson, pcdcp, plot, temperature, vbf}`
 
 Specify output format.
 
@@ -66,6 +66,9 @@ Specify output format.
 `iaga2002`
   IAGA2002 format.
 
+`imfjson`
+  IMFJSON format.
+
 `pcdcp`
   PCDCP format.
 
@@ -104,7 +107,7 @@ For output formats `binlog`, `iaga2002`, `pcdcp`, `temperature`, `vbf`
 `--output-file FILE`
   Write to a specific file.
 
-`--output-stdin`
+`--output-stdout`
   Write to standard output
 
 `--output-url URLTEMPLATE`
diff --git a/geomagio/Controller.py b/geomagio/Controller.py
index 7db68da0e..0ab147432 100644
--- a/geomagio/Controller.py
+++ b/geomagio/Controller.py
@@ -14,6 +14,7 @@ from . import TimeseriesUtility
 from . import binlog
 from . import edge
 from . import iaga2002
+from . import imfjson
 from . import pcdcp
 from . import imfv122
 from . import imfv283
@@ -378,6 +379,8 @@ def get_output_factory(args):
             output_factory = binlog.BinLogFactory(**output_factory_args)
         elif output_type == 'iaga2002':
             output_factory = iaga2002.IAGA2002Factory(**output_factory_args)
+        elif output_type == 'imfjson':
+            output_factory = imfjson.IMFJSONFactory(**output_factory_args)
         elif output_type == 'pcdcp':
             output_factory = pcdcp.PCDCPFactory(**output_factory_args)
         elif output_type == 'temperature':
@@ -766,6 +769,7 @@ def parse_args(args):
                 'binlog',
                 'edge',
                 'iaga2002',
+                'imfjson',
                 'pcdcp',
                 'plot',
                 'temperature',
-- 
GitLab