]> woffs.de Git - fd/haskell-amqp-utils.git/commitdiff
option cleanup
authorFrank Doepper <[email protected]>
Wed, 27 Jun 2018 11:23:36 +0000 (13:23 +0200)
committerFrank Doepper <[email protected]>
Wed, 27 Jun 2018 11:23:36 +0000 (13:23 +0200)
Network/AMQP/Utils/Options.hs
agitprop.hs

index 91a36d425db4119aae87467eefc728ff8674030e..bc2aedfa8fc7258fc7ca1cd7b48ca6c6d9dce3bf 100644 (file)
@@ -34,17 +34,16 @@ data Args = Args
   , inputFile :: String
   , lineMode :: Bool
   , confirm :: Bool
-  , msgtimestamp :: Maybe Timestamp
   , msgid :: Maybe Text
   , msgtype :: Maybe Text
-  , msguserid :: Maybe Text
-  , msgappid :: Maybe Text
-  , msgclusterid :: Maybe Text
-  , msgcontenttype :: Maybe Text
-  , msgcontentencoding :: Maybe Text
-  , msgreplyto :: Maybe Text
-  , msgprio :: Maybe Octet
-  , msgcorrid :: Maybe Text
+  , userid :: Maybe Text
+  , appid :: Maybe Text
+  , clusterid :: Maybe Text
+  , contenttype :: Maybe Text
+  , contentencoding :: Maybe Text
+  , replyto :: Maybe Text
+  , prio :: Maybe Octet
+  , corrid :: Maybe Text
   , msgexp :: Maybe Text
   , msgheader :: Maybe FieldTable
   , fnheader :: [ String ]
@@ -89,7 +88,6 @@ instance Default Args where
       Nothing
       Nothing
       Nothing
-      Nothing
       []
       []
 
@@ -230,11 +228,6 @@ aOptions =
       ["confirm"]
       (NoArg (\o -> o {confirm = not (confirm o)}))
       ("Toggle confirms (default: " ++ show (confirm def) ++ ")")
-  , Option
-      []
-      ["msgtimestamp"]
-      (ReqArg (\s o -> o {msgtimestamp = Just $ read s}) "TIMESTAMP")
-      ("Message Timestamp")
   , Option
       []
       ["msgid"]
@@ -242,54 +235,54 @@ aOptions =
       ("Message ID")
   , Option
       []
-      ["msgtype"]
+      ["type"]
       (ReqArg (\s o -> o {msgtype = Just $ pack s}) "TYPE")
       ("Message Type")
   , Option
       []
-      ["msguserid"]
-      (ReqArg (\s o -> o {msguserid = Just $ pack s}) "USERID")
-      ("Message UserID")
+      ["userid"]
+      (ReqArg (\s o -> o {userid = Just $ pack s}) "USERID")
+      ("Message User-ID")
   , Option
       []
-      ["msgappid"]
-      (ReqArg (\s o -> o {msgappid = Just $ pack s}) "APPID")
-      ("Message ApplicationID")
+      ["appid"]
+      (ReqArg (\s o -> o {appid = Just $ pack s}) "APPID")
+      ("Message App-ID")
   , Option
       []
-      ["msgclusterid"]
-      (ReqArg (\s o -> o {msgclusterid = Just $ pack s}) "CLUSTERID")
-      ("Message ClusterID")
+      ["clusterid"]
+      (ReqArg (\s o -> o {clusterid = Just $ pack s}) "CLUSTERID")
+      ("Message Cluster-ID")
   , Option
       []
-      ["msgcontenttype"]
-      (ReqArg (\s o -> o {msgcontenttype = Just $ pack s}) "CONTENTTYPE")
-      ("Message ContentType")
+      ["contenttype"]
+      (ReqArg (\s o -> o {contenttype = Just $ pack s}) "CONTENTTYPE")
+      ("Message Content-Type")
   , Option
       []
-      ["msgcontentencoding"]
+      ["contentencoding"]
       (ReqArg
-         (\s o -> o {msgcontentencoding = Just $ pack s})
+         (\s o -> o {contentencoding = Just $ pack s})
          "CONTENTENCODING")
-      ("Message ContentEncoding")
+      ("Message Content-Encoding")
   , Option
       []
-      ["msgreplyto"]
-      (ReqArg (\s o -> o {msgreplyto = Just $ pack s}) "REPLYTO")
-      ("Message ReplyTo")
+      ["replyto"]
+      (ReqArg (\s o -> o {replyto = Just $ pack s}) "REPLYTO")
+      ("Message Reply-To")
   , Option
       []
-      ["msgprio"]
-      (ReqArg (\s o -> o {msgprio = Just $ read s}) "PRIO")
+      ["prio"]
+      (ReqArg (\s o -> o {prio = Just $ read s}) "PRIO")
       ("Message Priority")
   , Option
       []
-      ["msgcorrid"]
-      (ReqArg (\s o -> o {msgcorrid = Just $ pack s}) "CORRID")
+      ["corrid"]
+      (ReqArg (\s o -> o {corrid = Just $ pack s}) "CORRID")
       ("Message CorrelationID")
   , Option
       []
-      ["msgexp"]
+      ["exp"]
       (ReqArg (\s o -> o {msgexp = Just $ pack s}) "EXP")
       ("Message Expiration")
   , Option
@@ -301,12 +294,12 @@ aOptions =
       ['F']
       ["fnheader"]
       (ReqArg (\s o -> o {fnheader = s:(fnheader o)}) "HEADERNAME")
-      ("Message Header for filename")
+      ("Put filename into this header")
   , Option
       ['S']
       ["suffix"]
       (ReqArg (\s o -> o {suffix = s:(suffix o)}) "SUFFIX")
-      ("Allowed file suffixes for hotfolder mode")
+      ("Allowed file suffixes in hotfolder mode")
   ]
 
 -- | Options for the executables
index a736f68db3c4da2b384eb6326317b2e93a22fe32..fd4922d298b621a7094b9e95db20168f8febe555 100644 (file)
@@ -112,14 +112,14 @@ publishOneMsg' c a fn f = do
         , msgTimestamp = Just now
         , msgID = msgid a
         , msgType = msgtype a
-        , msgUserID = msguserid a
-        , msgApplicationID = msgappid a
-        , msgClusterID = msgclusterid a
-        , msgContentType = msgcontenttype a
-        , msgContentEncoding = msgcontentencoding a
-        , msgReplyTo = msgreplyto a
-        , msgPriority = msgprio a
-        , msgCorrelationID = msgcorrid a
+        , msgUserID = userid a
+        , msgApplicationID = appid a
+        , msgClusterID = clusterid a
+        , msgContentType = contenttype a
+        , msgContentEncoding = contentencoding a
+        , msgReplyTo = replyto a
+        , msgPriority = prio a
+        , msgCorrelationID = corrid a
         , msgExpiration = msgexp a
         , msgHeaders = substheader (fnheader a) fn $ msgheader a
         }