summaryrefslogtreecommitdiff
path: root/GitAnnex.hs
diff options
context:
space:
mode:
Diffstat (limited to 'GitAnnex.hs')
-rw-r--r--GitAnnex.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/GitAnnex.hs b/GitAnnex.hs
index 40ebed0d6..7243d69cb 100644
--- a/GitAnnex.hs
+++ b/GitAnnex.hs
@@ -18,6 +18,7 @@ import Types.TrustLevel
import qualified Annex
import qualified Remote
import qualified Limit
+import qualified Utility.Format
import qualified Command.Add
import qualified Command.Unannex
@@ -108,8 +109,10 @@ options = commonOptions ++
"override trust setting to untrusted"
, Option ['c'] ["config"] (ReqArg setgitconfig "NAME=VALUE")
"override git configuration setting"
- , Option [] ["print0"] (NoArg (setprint0 True))
- "terminate filename with null"
+ , Option [] ["print0"] (NoArg setprint0)
+ "terminate output with null"
+ , Option [] ["format"] (ReqArg setformat paramFormat)
+ "control format of output"
, Option ['x'] ["exclude"] (ReqArg Limit.addExclude paramGlob)
"skip files matching the glob pattern"
, Option ['I'] ["include"] (ReqArg Limit.addInclude paramGlob)
@@ -125,7 +128,8 @@ options = commonOptions ++
setto v = Annex.changeState $ \s -> s { Annex.toremote = Just v }
setfrom v = Annex.changeState $ \s -> s { Annex.fromremote = Just v }
setnumcopies v = Annex.changeState $ \s -> s {Annex.forcenumcopies = readMaybe v }
- setprint0 v = Annex.changeState $ \s -> s { Annex.print0 = v }
+ setformat v = Annex.changeState $ \s -> s { Annex.format = Just $ Utility.Format.gen v }
+ setprint0 = setformat "${file}\0"
setgitconfig :: String -> Annex ()
setgitconfig v = do
newg <- inRepo $ Git.Config.store v