-
Notifications
You must be signed in to change notification settings - Fork 310
differentiating required and optional arguments in the help text for … #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@anusha94, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
parser.add_argument('--refresh_token', | ||
required_args = parser.add_argument_group('required arguments') | ||
|
||
required_args.add_argument('--refresh_token', | ||
required=True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to maintain the vertical alignment..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified in the next commit
Signed-off-by: Anusha Hegde <[email protected]>
@anusha94, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
@@ -39,7 +39,8 @@ def __init__(self): | |||
parser = argparse.ArgumentParser( | |||
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |||
|
|||
required_args = parser.add_argument_group('required arguments') | |||
required_args = parser.add_argument_group( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required_args is repeated in all the sample files. Can we declare it in library and use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in the next commit
- new
sample_cli.py
file in thehelpers
directory - all other samples will import
parser
,required_args
andoptional_args
as needed
Signed-off-by: Anusha Hegde <[email protected]>
@anusha94, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
Signed-off-by: Anusha Hegde <[email protected]>
@anusha94, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
required=True, | ||
help='VMware Cloud API refresh token') | ||
required_args.add_argument( | ||
'--org-id', required=True, help='Organization identifier.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the samples require org_id and sddc_id. Please check if we can move both to sample_cli.py and build seperate arg parser where it is not required
Signed-off-by: Anusha Hegde <[email protected]>
@anusha94, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
import requests | ||
from samples.vmc.helpers.sample_cli import parser, required_args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required_args is not required here?
samples/vmc/sddc/sddc_crud.py
Outdated
@@ -34,51 +33,52 @@ class CreateDeleteSDDC(object): | |||
""" | |||
|
|||
def __init__(self): | |||
parser = argparse.ArgumentParser() | |||
parser = argparse.ArgumentParser( | |||
description='Standard Arguments for talking to vCenter') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the description
samples/vmc/tasks/list_tasks.py
Outdated
help='Task status to filter. Possible values are: {} \ | ||
Show all tasks if no value is passed'.format(accepted)) | ||
parser = argparse.ArgumentParser( | ||
description='Standard Arguments for talking to vCenter') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct the description
Signed-off-by: Anusha Hegde <[email protected]>
@anusha94, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
@anusha94, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
By default, all the keyword arguments are listed under the optional arguments section. This will lead to confusion to the user as to which arguments are required and actually optional.
To solve this problem, I have created an argument group called required arguments and listed all the required args under this header.
This PR contains modifications to VMC samples only.