diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-03-05 14:46:08 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-03-05 14:46:08 -0400 |
commit | 5e38a5fba69a7b13036e2910e74e2c72d5c9da30 (patch) | |
tree | 62ee4e3dba5b40537d8341cbd407a37099241f94 /Command/AddUrl.hs | |
parent | f4d69c300199cc43532c0a82661b5396f3de5a46 (diff) |
addurl: Added --raw option, which bypasses special handling of quvi, bittorrent etc urls.
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r-- | Command/AddUrl.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 426bc372c..f8a4ca59b 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -38,7 +38,7 @@ import qualified Utility.Quvi as Quvi #endif cmd :: [Command] -cmd = [notBareRepo $ withOptions [fileOption, pathdepthOption, relaxedOption] $ +cmd = [notBareRepo $ withOptions [fileOption, pathdepthOption, relaxedOption, rawOption] $ command "addurl" (paramRepeating paramUrl) seek SectionCommon "add urls to annex"] @@ -51,14 +51,18 @@ pathdepthOption = fieldOption [] "pathdepth" paramNumber "path components to use relaxedOption :: Option relaxedOption = flagOption [] "relaxed" "skip size check" +rawOption :: Option +rawOption = flagOption [] "raw" "disable special handling for torrents, quvi, etc" + seek :: CommandSeek seek us = do optfile <- getOptionField fileOption return relaxed <- getOptionFlag relaxedOption + raw <- getOptionFlag rawOption pathdepth <- getOptionField pathdepthOption (return . maybe Nothing readish) forM_ us $ \u -> do r <- Remote.claimingUrl u - if Remote.uuid r == webUUID + if Remote.uuid r == webUUID || raw then void $ commandAction $ startWeb relaxed optfile pathdepth u else do pathmax <- liftIO $ fileNameLengthLimit "." |