Skip to content

Commit 5cc9ecf

Browse files
ebernashatakshiiii
andauthored
arg parser add subcommand use default path (./) if not specied in cli (#426)
Co-authored-by: Shatakshi Mishra <[email protected]>
1 parent f7167fb commit 5cc9ecf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ansible_creator/arg_parser.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def _add_args_plugin_common(self, parser: ArgumentParser) -> None:
190190
parser.add_argument(
191191
"path",
192192
default="./",
193+
nargs="?",
193194
help="The path to the Ansible collection. The default is the "
194195
"current working directory.",
195196
)
@@ -233,6 +234,7 @@ def _add_resource_devcontainer(self, subparser: SubParser[ArgumentParser]) -> No
233234
"path",
234235
default="./",
235236
metavar="path",
237+
nargs="?",
236238
help="The destination directory for the devcontainer files. The default is the "
237239
"current working directory.",
238240
)
@@ -264,6 +266,7 @@ def _add_resource_devfile(self, subparser: SubParser[ArgumentParser]) -> None:
264266
"path",
265267
default="./",
266268
metavar="path",
269+
nargs="?",
267270
help="The destination directory for the devfile file. The default is the "
268271
"current working directory.",
269272
)
@@ -287,6 +290,7 @@ def _add_resource_execution_env(self, subparser: SubParser[ArgumentParser]) -> N
287290
"path",
288291
default="./",
289292
metavar="path",
293+
nargs="?",
290294
help="The destination directory for the execution environment file. "
291295
"The default is the current working directory.",
292296
)
@@ -315,6 +319,7 @@ def _add_resource_patterns(self, subparser: SubParser[ArgumentParser]) -> None:
315319
"path",
316320
default="./",
317321
metavar="path",
322+
nargs="?",
318323
help="The path to the Ansible collection. The default is the "
319324
"current working directory.",
320325
)
@@ -337,6 +342,7 @@ def _add_resource_play_argspec(self, subparser: SubParser[ArgumentParser]) -> No
337342
"path",
338343
default="./",
339344
metavar="path",
345+
nargs="?",
340346
help="The destination directory for the playbook argspec files. The default is the "
341347
"current working directory.",
342348
)
@@ -363,6 +369,7 @@ def _add_resource_role(self, subparser: SubParser[ArgumentParser]) -> None:
363369
"path",
364370
default="./",
365371
metavar="path",
372+
nargs="?",
366373
help="The path to the Ansible collection. The default is the "
367374
"current working directory.",
368375
)

0 commit comments

Comments
 (0)