Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a4a940

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 resourceFor 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 parent840572e commit5a4a940

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-
foraction_namein ["list","get","create","update","delete"]:
210+
foraction_name,help_textin [
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
ifnothasattr(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)

[8]ページ先頭

©2009-2025 Movatter.jp