From 5c2864116423c11db8bac5b1a48f6cbb7cc450fb Mon Sep 17 00:00:00 2001 From: ashvaneetk <123331072+ashvaneetk@users.noreply.github.com> Date: Mon, 22 May 2023 19:36:34 +0530 Subject: [PATCH] #10 Adding an argument for 'description' of the GitHub repository With the following changes, After parsing the arguments, you can access their values using args.argument_name. For example, args.path will provide the value of the path argument, and args.description will provide the value of the description argument (if provided). --- scripts/create_repo | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/create_repo b/scripts/create_repo index 968053b..9d3c5fa 100644 --- a/scripts/create_repo +++ b/scripts/create_repo @@ -11,18 +11,23 @@ if not GITHUB_API_TOKEN: URL = "https://api.github.com/user/repos" -parser = argparse.ArgumentParser(description='creates a local repository linked with a remote repository') # noqa: E501 - -parser.add_argument('path', - metavar='PATH', - type=str, +parser = argparse.ArgumentParser(description='creates a local repository linked with a remote repository') +parser.add_argument('path', + metavar='PATH', + type=str, help='Enter the path for the new repository') -parser.add_argument('name', - metavar='NAME', - type=str, +parser.add_argument('name', + metavar='NAME', + type=str, help='Enter a name for the new repository') +parser.add_argument('-d', + '--description', + metavar='DESCRIPTION', + type=str, + help='Enter a description for the new repository') args = parser.parse_args() + name = args.name path = args.path