summaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index be65c8856..dab7b4161 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -295,14 +295,13 @@ options =
, Option "V" ["variable"]
(ReqArg
- (\arg opt ->
- case break (`elem` ":=") arg of
- (k,_:v) -> do
- let newvars = optVariables opt ++ [(k,v)]
- return opt{ optVariables = newvars }
- _ -> err 17 $
- "Could not parse `" ++ arg ++ "' as a key/value pair (k=v or k:v)")
- "KEY:VALUE")
+ (\arg opt -> do
+ let (key,val) = case break (`elem` ":=") arg of
+ (k,_:v) -> (k,v)
+ (k,_) -> (k,"true")
+ let newvars = optVariables opt ++ [(key,val)]
+ return opt{ optVariables = newvars })
+ "KEY[:VALUE]")
"" -- "Use custom template"
, Option "D" ["print-default-template"]