if version don't try to create object

This commit is contained in:
Akash 2020-07-22 17:15:28 +05:30 committed by GitHub
parent 78a608db50
commit 7fa7b59ce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,11 @@ def main():
args = parser.parse_args()
if not args.url and not args.version:
if args.version:
print(__version__)
return
if not args.url:
print("Specify an URL using \"--url https://mywebiste.com\". Use --help for help.")
return
@ -94,8 +98,6 @@ def main():
_near(obj, args)
elif args.get:
_get(obj, args)
elif args.version:
print(__version__)
else:
print("Usage: waybackpy [OPTIONS] --url [URL...] --user_agent [USER AGENT].\
\nwaybackpy: error: You must provide at least one URL. See --help\