From 7f7ae7a3b1cdfbc61879189dfe04a637690015aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 22 Nov 2011 14:06:31 -0400 Subject: find: Support --print0 It would be nice if command-specific options were supported. The first difficulty is that which command is being called is not known until after getopt; but that could be worked around by finding the first non-dashed parameter. Storing the settings without putting them in the annex monad is the next difficulty; it could perhaps be handled by making the seek stage pass applicable settings into the start stage (and from there on to perform as needed). But that still leaves a problem, what data type to use to represent the options between getopt and seek? --- GitAnnex.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'GitAnnex.hs') diff --git a/GitAnnex.hs b/GitAnnex.hs index 7b51602be..f563c08cb 100644 --- a/GitAnnex.hs +++ b/GitAnnex.hs @@ -103,6 +103,8 @@ 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 ['x'] ["exclude"] (ReqArg Limit.addExclude paramGlob) "skip files matching the glob pattern" , Option ['i'] ["in"] (ReqArg Limit.addIn paramRemote) @@ -114,6 +116,7 @@ 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 } setgitconfig :: String -> Annex () setgitconfig v = do newg <- inRepo $ Git.configStore v -- cgit v1.2.3