import Data.Maybe
import Data.Text (Text, pack)
import Data.Version (showVersion)
+import Network.AMQP
import Network.AMQP.Types
import Paths_amqp_utils (version)
import System.Console.GetOpt
, fnheader :: [String]
, suffix :: [String]
, magic :: Bool
+ , persistent :: Maybe DeliveryMode
}
instance Default Args where
[]
[]
False
+ Nothing
-- | Common options
cOptions :: [OptDescr (Args -> Args)]
['m']
["magic"]
(NoArg (\o -> o {magic = not (magic o)}))
- ("Toggle setting content-type and -encoding from file contents (default: " ++ show (magic def) ++ ")")
+ ("Toggle setting content-type and -encoding from file contents (default: " ++
+ show (magic def) ++ ")")
+ , Option
+ []
+ ["persistent"]
+ (NoArg (\o -> o {persistent = Just Persistent}))
+ "Set persistent delivery"
+ , Option
+ []
+ ["nonpersistent"]
+ (NoArg (\o -> o {persistent = Just NonPersistent}))
+ "Set nonpersistent delivery"
]
-- | Options for the executables
(T.pack $ rKey a)
newMsg
{ msgBody = f
- , msgDeliveryMode = Just Persistent
+ , msgDeliveryMode = persistent a
, msgTimestamp = Just now
, msgID = msgid a
, msgType = msgtype a