aboutsummaryrefslogtreecommitdiffstats
path: root/cli/app/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/app/Main.hs')
-rw-r--r--cli/app/Main.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/app/Main.hs b/cli/app/Main.hs
index eaabd0a..ef7a8ad 100644
--- a/cli/app/Main.hs
+++ b/cli/app/Main.hs
@@ -18,6 +18,7 @@ import Options.Applicative qualified as O
import Text.ParserCombinators.ReadP qualified as R
import Text.ParserCombinators.ReadPrec qualified as R
import Text.Read (Read (..))
+import Debug.Trace
data Args = Args
{ cmd :: Cmd
@@ -96,18 +97,18 @@ main =
{ cmd = CollectionCmd cmd
} -> case cmd of
CollectionAdd (Collection cn) -> do
- print
+ LB.putStr . J.encodePretty
=<< ACMS.API.REST.Collection.create cn
=<< J.throwDecode
=<< LB.getContents
CollectionView CollectionItem {collection = Collection cn, itemFileName} ->
- print
+ LB.putStr . J.encodePretty
=<< ACMS.API.REST.Collection.read cn itemFileName
CollectionDelete CollectionItem {collection = Collection cn, itemFileName} ->
- print
+ LB.putStr . J.encodePretty
=<< ACMS.API.REST.Collection.delete cn itemFileName
CollectionEdit CollectionItem {collection = Collection cn, itemFileName} ->
- print
+ LB.putStr . J.encodePretty
=<< ACMS.API.REST.Collection.update cn itemFileName
=<< J.throwDecode
=<< LB.getContents