Skip to content

Commit

Permalink
- Eliminated __name__ == '__main__"
Browse files Browse the repository at this point in the history
- main now prints token to stdout
  • Loading branch information
Froilan Irizarry committed May 18, 2017
1 parent 3878ff1 commit a31bfe0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions jwt/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,16 @@ def build_argparser():
return arg_parser


def main(args):
def main():
arg_parser = build_argparser()

try:
arguments = arg_parser.parse_args(args)
arguments = arg_parser.parse_args(sys.argv[1:])

return arguments.func(arguments)
output = arguments.func(arguments)

print(output)
except Exception as e:
print('There was an unforseen error: ', e)
arg_parser.print_help()
sys.exit(1)


if __name__ == '__main__':
output = main(sys.argv[1:])

print(output)

0 comments on commit a31bfe0

Please sign in to comment.