From e1e0817b80ce1031d21587357bfb8dc4e7837b01 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Wed, 20 Nov 2019 13:23:03 -0500
Subject: [PATCH] easier to use command line syntax for allow-origin

---
 src/PaymentServer/Main.hs | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/PaymentServer/Main.hs b/src/PaymentServer/Main.hs
index a6b206c..ad66ee0 100644
--- a/src/PaymentServer/Main.hs
+++ b/src/PaymentServer/Main.hs
@@ -53,6 +53,7 @@ import Options.Applicative
   , ParserInfo
   , strOption
   , option
+  , many
   , auto
   , str
   , optional
@@ -166,11 +167,13 @@ sample = ServerConfig
   <*> option str
   ( long "stripe-key-path"
     <> help "Path to Stripe Secret key" )
-  <*> option auto
-  ( long "allow-origin"
-    <> help "For the charge endpoint, a list of CORS origins to allow."
-    <> showDefault
-    <> value [] )
+  <*> many
+  ( option str
+    ( long "allow-origin"
+      <> help "For the charge endpoint, a CORS origin to allow."
+      <> showDefault
+    )
+  )
 
 opts :: ParserInfo ServerConfig
 opts = info (sample <**> helper)
-- 
GitLab