summaryrefslogtreecommitdiff
path: root/Command/AddUrl.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r--Command/AddUrl.hs22
1 files changed, 14 insertions, 8 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index ed76e6c35..4ae80d9d4 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -61,14 +61,20 @@ optParser desc = AddUrlOptions
( long "pathdepth" <> metavar paramNumber
<> help "path components to use in filename"
))
- <*> switch
- ( long "relaxed"
- <> help "skip size check"
- )
- <*> switch
- ( long "raw"
- <> help "disable special handling for torrents, quvi, etc"
- )
+ <*> parseRelaxedOption
+ <*> parseRawOption
+
+parseRelaxedOption :: Parser Bool
+parseRelaxedOption = switch
+ ( long "relaxed"
+ <> help "skip size check"
+ )
+
+parseRawOption :: Parser Bool
+parseRawOption = switch
+ ( long "raw"
+ <> help "disable special handling for torrents, quvi, etc"
+ )
seek :: AddUrlOptions -> CommandSeek
seek o = forM_ (addUrls o) $ \u -> do