diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-06 10:14:37 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-06 10:57:57 -0400 |
commit | 1f8a1058c96bd4ee11fcb353f0ede1842d79ab6a (patch) | |
tree | 0754233445da5c75737aa2b7866881d30939ec56 /Command/Find.hs | |
parent | df21cbfdd2b7342c206ebd4aea32d989328374dc (diff) |
tweak
Diffstat (limited to 'Command/Find.hs')
-rw-r--r-- | Command/Find.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Command/Find.hs b/Command/Find.hs index 8760cc947..902f50d2e 100644 --- a/Command/Find.hs +++ b/Command/Find.hs @@ -17,20 +17,23 @@ import qualified Annex import qualified Utility.Format import Utility.DataUnits import Types.Key +import qualified Option def :: [Command] def = [withOptions [formatOption, print0Option] $ command "find" paramPaths seek "lists available files"] +formatOption :: Option +formatOption = Option.field [] "format" paramFormat "control format of output" + print0Option :: Option -print0Option = Option [] ["print0"] (NoArg $ Annex.setField "format" "${file}\0") +print0Option = Option.Option [] ["print0"] (Option.NoArg set) "terminate output with null" - -formatOption :: Option -formatOption = fieldOption [] "format" paramFormat "control format of output" + where + set = Annex.setField (Option.name formatOption) "${file}\0" seek :: [CommandSeek] -seek = [withField "format" formatconverter $ \f -> +seek = [withField formatOption formatconverter $ \f -> withFilesInGit $ whenAnnexed $ start f] where formatconverter = return . maybe Nothing (Just . Utility.Format.gen) |