Skip to content

Commit fc68e9b

Browse files
author
Gauvain Pocentek
committed
implement CLI for project archive/unarchive/share
1 parent e7c4125 commit fc68e9b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

gitlab/cli.py

+25-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@
6161
'all': {},
6262
'starred': {},
6363
'star': {'required': ['id']},
64-
'unstar': {'required': ['id']}},
64+
'unstar': {'required': ['id']},
65+
'archive': {'required': ['id']},
66+
'unarchive': {'required': ['id']},
67+
'share': {'required': ['id', 'group-id', 'group-access']}},
6568
gitlab.User: {'block': {'required': ['id']},
6669
'unblock': {'required': ['id']},
6770
'search': {'required': ['query']},
@@ -205,6 +208,27 @@ def do_project_unstar(self, cls, gl, what, args):
205208
except Exception as e:
206209
_die("Impossible to unstar project (%s)" % str(e))
207210

211+
def do_project_archive(self, cls, gl, what, args):
212+
try:
213+
o = self.do_get(cls, gl, what, args)
214+
o.archive_()
215+
except Exception as e:
216+
_die("Impossible to archive project (%s)" % str(e))
217+
218+
def do_project_unarchive(self, cls, gl, what, args):
219+
try:
220+
o = self.do_get(cls, gl, what, args)
221+
o.unarchive_()
222+
except Exception as e:
223+
_die("Impossible to unarchive project (%s)" % str(e))
224+
225+
def do_project_share(self, cls, gl, what, args):
226+
try:
227+
o = self.do_get(cls, gl, what, args)
228+
o.share(args['group_id'], args['group_access'])
229+
except Exception as e:
230+
_die("Impossible to share project (%s)" % str(e))
231+
208232
def do_user_block(self, cls, gl, what, args):
209233
try:
210234
o = self.do_get(cls, gl, what, args)

0 commit comments

Comments
 (0)