8000 Add required flag on certain arguments to command-line tools · johnmanong/python-docs-samples@3f92d71 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f92d71

Browse files
committed
Add required flag on certain arguments to command-line tools
1 parent fcd8186 commit 3f92d71

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

appengine/flexible/tasks/create_app_engine_queue_task.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,20 @@ def create_task(project, queue, location, payload=None, in_seconds=None):
8080

8181
parser.add_argument(
8282
'--project',
83-
help='Project of the queue to add the task to.'
83+
help='Project of the queue to add the task to.',
84+
required=True,
8485
)
8586

8687
parser.add_argument(
8788
'--queue',
88-
help='ID (short name) of the queue to add the task to.'
89+
help='ID (short name) of the queue to add the task to.',
90+
required=True,
8991
)
9092

9193
parser.add_argument(
9294
'--location',
93-
help='Location of the queue to add the task to.'
95+
help='Location of the queue to add the task to.',
96+
required=True,
9497
)
9598

9699
parser.add_argument(

tasks/pull_queue_snippets.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,31 +105,37 @@ def acknowledge_task(task):
105105
help=create_task.__doc__)
106106
create_task_parser.add_argument(
107107
'--project',
108-
help='Project of the queue to add the task to.'
108+
help='Project of the queue to add the task to.',
109+
required=True,
109110
)
110111
create_task_parser.add_argument(
111112
'--queue',
112-
help='ID (short name) of the queue to add the task to.'
113+
help='ID (short name) of the queue to add the task to.',
114+
required=True,
113115
)
114116
create_task_parser.add_argument(
115117
'--location',
116-
help='Location of the queue to add the task to.'
118+
help='Location of the queue to add the task to.',
119+
required=True,
117120
)
118121

119122
pull_and_ack_parser = subparsers.add_parser(
120123
'pull-and-ack-task',
121124
help=create_task.__doc__)
122125
pull_and_ack_parser.add_argument(
123126
'--project',
124-
help='Project of the queue to pull the task from.'
127+
help='Project of the queue to pull the task from.',
128+
required=True,
125129
)
126130
pull_and_ack_parser.add_argument(
127131
'--queue',
128-
help='ID (short name) of the queue to pull the task from.'
132+
help='ID (short name) of the queue to pull the task from.',
133+
required=True,
129134
)
130135
pull_and_ack_parser.add_argument(
131136
'--location',
132-
help='Location of the queue to pull the task from.'
137+
help='Location of the queue to pull the task from.',
138+
required=True,
133139
)
134140

135141
args = parser.parse_args()

0 commit comments

Comments
 (0)
0