Skip to content

Commit

Permalink
sahil-sagwekar2652#10 Adding an argument for 'description' of the Git…
Browse files Browse the repository at this point in the history
…Hub 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).
  • Loading branch information
ashvaneetk committed May 22, 2023
1 parent 85b38dd commit 5c28641
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scripts/create_repo
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5c28641

Please sign in to comment.