8000 chore(cli): add some simple help for the standard operations · python-gitlab/python-gitlab@5a4a940 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 5a4a940

Browse files
JohnVillalovosnejch
authored andcommitted
chore(cli): add some simple help for the standard operations
Add help for the following standard operations: * list: List the GitLab resources * get: Get a GitLab resource * create: Create a GitLab resource * update: Update a GitLab resource * delete: Delete a GitLab resource For example: $ gitlab project-key --help usage: gitlab project-key [-h] {list,get,create,update,delete,enable} ... options: -h, --help show this help message and exit action: list get create update delete enable Action to execute on the GitLab resource. list List the GitLab resources get Get a GitLab resource create Create a GitLab resource update Update a GitLab resource delete Delete a GitLab resource
1 parent 840572e commit 5a4a940

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

gitlab/v4/cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,20 @@ def _populate_sub_parser_by_class(
207207
mgr_cls = getattr(gitlab.v4.objects, mgr_cls_name)
208208

209209
action_parsers: Dict[str, argparse.ArgumentParser] = {}
210-
for action_name in ["list", "get", "create", "update", "delete"]:
210+
for action_name, help_text in [
211+
("list", "List the GitLab resources"),
212+
("get", "Get a GitLab resource"),
213+
("create", "Create a GitLab resource"),
214+
("update", "Update a GitLab resource"),
215+
("delete", "Delete a GitLab resource"),
216+
]:
211217
if not hasattr(mgr_cls, action_name):
212218
continue
213219

214220
sub_parser_action = sub_parser.add_parser(
215-
action_name, conflict_handler="resolve"
221+
action_name,
222+
conflict_handler="resolve",
223+
help=help_text,
216224
)
217225
action_parsers[action_name] = sub_parser_action
218226
sub_parser_action.add_argument("--sudo", required=False)

0 commit comments

Comments
 (0)
0