Conversation
tbarbugli
commented
Jun 25, 2024
|
|
||
| return update_wrapper(new_func, f) | ||
|
|
||
| def json_option(option_name): |
Member
Author
There was a problem hiding this comment.
what does this do? lets add a docstring with example
tbarbugli
commented
Jun 25, 2024
getstream/cli/video.py
Outdated
|
|
||
| return cmd | ||
|
|
||
| def add_option(cmd, param_name, param): |
Member
Author
There was a problem hiding this comment.
add_option_from_arg is bit easier to understand
Member
Author
There was a problem hiding this comment.
what about optional vs not optional?
Member
Author
There was a problem hiding this comment.
highly suggested to write a bunch of unit tests for this function (fastest way to make it 100%)
tbarbugli
commented
Jun 25, 2024
getstream/cli/video.py
Outdated
| cmd = click.option(f'--{param_name}', type=int)(cmd) | ||
| elif param.annotation == bool: | ||
| cmd = click.option(f'--{param_name}', is_flag=True)(cmd) | ||
| elif param.annotation == list: |
Member
Author
There was a problem hiding this comment.
this is probably not good enough: a list of strings or a list of numbers can be handled with click options multiple. A list of lists or structs needs to be provided as json encoded string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Examples:
Missing stuff:

Once we have this, we can have commands like these work out of the box and without any manual work