diff options
Diffstat (limited to 'Command/View.hs')
-rw-r--r-- | Command/View.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Command/View.hs b/Command/View.hs index 584cf091f..b39aef7d9 100644 --- a/Command/View.hs +++ b/Command/View.hs @@ -19,16 +19,17 @@ import Logs.View cmd :: Command cmd = notBareRepo $ notDirect $ - command "view" paramView seek SectionMetaData "enter a view branch" + command "view" SectionMetaData "enter a view branch" + paramView (withParams seek) -seek :: CommandSeek +seek :: CmdParams -> CommandSeek seek = withWords start start :: [String] -> CommandStart start [] = error "Specify metadata to include in view" -start params = do +start ps = do showStart "view" "" - view <- mkView params + view <- mkView ps go view =<< currentView where go view Nothing = next $ perform view @@ -45,11 +46,11 @@ paramView :: String paramView = paramRepeating "FIELD=VALUE" mkView :: [String] -> Annex View -mkView params = go =<< inRepo Git.Branch.current +mkView ps = go =<< inRepo Git.Branch.current where go Nothing = error "not on any branch!" go (Just b) = return $ fst $ refineView (View b []) $ - map parseViewParam $ reverse params + map parseViewParam $ reverse ps checkoutViewBranch :: View -> (View -> Annex Git.Branch) -> CommandCleanup checkoutViewBranch view mkbranch = do |