Format strings can be specified using the new --find option, to control what is output by git annex find.
This commit is contained in:
parent
cf496f09ab
commit
06bafae9e0
7 changed files with 47 additions and 11 deletions
10
GitAnnex.hs
10
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue