summaryrefslogtreecommitdiff
path: root/Command/Find.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-05 22:48:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-05 23:11:07 -0400
commitad43f0362688a601ba43f462e80f5a91bf398c02 (patch)
tree550788062a775eb6b2c2c087052993aa10435875 /Command/Find.hs
parent47be4383b714320c9e3f49cc23315101fad5735b (diff)
per-command options
Finally commands can define their own options. Moved --format and --print0 to be options only of find.
Diffstat (limited to 'Command/Find.hs')
-rw-r--r--Command/Find.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Command/Find.hs b/Command/Find.hs
index 0c96369ee..c86db5fa6 100644
--- a/Command/Find.hs
+++ b/Command/Find.hs
@@ -1,6 +1,6 @@
{- git-annex command
-
- - Copyright 2010 Joey Hess <joey@kitenet.net>
+ - Copyright 2010-2012 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -19,7 +19,12 @@ import Utility.DataUnits
import Types.Key
def :: [Command]
-def = [command "find" paramPaths seek "lists available files"]
+def = [withOptions [formatOption, print0Option] $
+ command "find" paramPaths seek "lists available files"]
+
+print0Option :: Option
+print0Option = Option [] ["print0"] (NoArg $ setFormat "${file}\0")
+ "terminate output with null"
seek :: [CommandSeek]
seek = [withFilesInGit $ whenAnnexed start]