aboutsummaryrefslogtreecommitdiff
path: root/Command/Group.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-05-16 14:43:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-05-16 14:43:40 -0400
commitc7f3a1e39f4282fe41c8d81e07ee33addeae49ab (patch)
tree8e2d010102876d6b2e6b66c84db2e54767f6d129 /Command/Group.hs
parent7ed2289f4618a857221558fcf6948c05f3176de8 (diff)
group: When no groups are specified to set, lists the current groups of a repository.
Diffstat (limited to 'Command/Group.hs')
-rw-r--r--Command/Group.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Command/Group.hs b/Command/Group.hs
index b0dbc1465..2b5cd2ec4 100644
--- a/Command/Group.hs
+++ b/Command/Group.hs
@@ -26,10 +26,14 @@ start :: [String] -> CommandStart
start (name:g:[]) = do
showStart "group" name
u <- Remote.nameToUUID name
- next $ perform u g
+ next $ setGroup u g
+start (name:[]) = do
+ u <- Remote.nameToUUID name
+ showRaw . unwords . S.toList =<< lookupGroups u
+ stop
start _ = error "Specify a repository and a group."
-perform :: UUID -> Group -> CommandPerform
-perform uuid g = do
+setGroup :: UUID -> Group -> CommandPerform
+setGroup uuid g = do
groupChange uuid (S.insert g)
next $ return True