diff options
Diffstat (limited to 'src/Text/Pandoc/App/CommandLineOptions.hs')
-rw-r--r-- | src/Text/Pandoc/App/CommandLineOptions.hs | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index a6df12715..759f8ac35 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -33,10 +33,8 @@ import Data.Bifunctor (second) import Data.Char (toLower) import Data.List (intercalate, sort, foldl') #ifdef _WINDOWS -#if MIN_VERSION_base(4,12,0) import Data.List (isPrefixOf) #endif -#endif import Data.Maybe (fromMaybe, isJust) import Data.Text (Text) import Safe (tailDef) @@ -188,6 +186,11 @@ options = (\opt -> return opt { optFileScope = True })) "" -- "Parse input files before combining" + , Option "" ["sandbox"] + (NoArg + (\opt -> return opt { optSandbox = True })) + "" + , Option "s" ["standalone"] (NoArg (\opt -> return opt { optStandalone = True })) @@ -332,14 +335,8 @@ options = , Option "" ["syntax-definition"] (ReqArg - (\arg opt -> do - let tr c d = map (\x -> if x == c then d else x) - let arg' = case arg of -- see #4836 - -- HXT confuses Windows path with URI - _:':':'\\':_ -> - "file:///" ++ tr '\\' '/' arg - _ -> normalizePath arg - return opt{ optSyntaxDefinitions = arg' : + (\arg opt -> + return opt{ optSyntaxDefinitions = normalizePath arg : optSyntaxDefinitions opt }) "FILE") "" -- "Syntax definition (xml) file" @@ -576,10 +573,10 @@ options = (ReqArg (\arg opt -> case safeStrRead arg of - Just t | t >= 1 && t <= 6 -> + Just t | t >= 0 && t <= 6 -> return opt { optSlideLevel = Just t } _ -> E.throwIO $ PandocOptionError - "slide level must be a number between 1 and 6") + "slide level must be a number between 0 and 6") "NUMBER") "" -- "Force header level for slides" @@ -1079,7 +1076,6 @@ readMetaValue s -- beginning with \\ to \\?\UNC\. -- See #5127. normalizePath :: FilePath -> FilePath #ifdef _WINDOWS -#if MIN_VERSION_base(4,12,0) normalizePath fp = if "\\\\" `isPrefixOf` fp && not ("\\\\?\\" `isPrefixOf` fp) then "\\\\?\\UNC\\" ++ drop 2 fp @@ -1087,6 +1083,3 @@ normalizePath fp = #else normalizePath = id #endif -#else -normalizePath = id -#endif |