forked from dbarnett/python-helloworld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (17 loc) · 672 Bytes
/
Copy pathmain.py
File metadata and controls
26 lines (17 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Top-level implementation of the helloworld program."""
import argparse
import sys
import helloworld
parser = argparse.ArgumentParser(
description='A simple example program to print a friendly greeting.')
parser.add_argument('--version', action='version',
version='helloworld ' + helloworld.__version__)
def main(argv=None):
if argv is None:
argv = sys.argv
# The helloworld program doesn't expect any arguments.
# This just checks for the special --version and --help arguments and
# ensures the user hasn't passed any other unrecognized arguments.
parser.parse_args(argv[1:])
print("Hello, world")
return 0