diff --git a/httpsh b/httpshell/repl.py similarity index 84% rename from httpsh rename to httpshell/repl.py index 77bd200..a46cc0f 100755 --- a/httpsh +++ b/httpshell/repl.py @@ -2,11 +2,11 @@ # -*- coding: utf-8 -*- import argparse -from httpshell import httpshell -from httpshell import version +from . import httpshell +from . import version -def parse_command_line(): +def parse_command_line(argv=None): parser = argparse.ArgumentParser( description="An interactive shell for issuing HTTP commands to a web server or REST API") @@ -41,14 +41,11 @@ def parse_command_line(): action="version", version="{0} {1}".format("%(prog)s", version.VERSION)) - return parser.parse_args() + return parser.parse_args(argv) -def main(): - args = parse_command_line() +def main(argv=None): + args = parse_command_line(argv) shell = httpshell.HttpShell(args) shell.input_loop() - - -if __name__ == "__main__": - main() + \ No newline at end of file diff --git a/setup.py b/setup.py index c24c3ef..33d050f 100644 --- a/setup.py +++ b/setup.py @@ -21,25 +21,28 @@ setup( name="httpshell", version=version.VERSION, - packages=["httpshell"], - install_requires=REQUIRES, - py_modules=["ez_setup"], - scripts=["httpsh"], - author="Chris Longo", - author_email="chris.longo@gmail.com", + description="An interactive shell for issuing HTTP commands to a web server or REST API", url="https://github.com/chrislongo/HttpShell/", download_url="http://github.com/downloads/chrislongo/HttpShell/httpshell-%s.tar.gz" % version.VERSION, - description="An interactive shell for issuing HTTP commands to a web server or REST API", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - 'Programming Language :: Python :: 2.4', - 'Programming Language :: Python :: 2.5', - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Topic :: System :: Networking" - ] - ) + author="Chris Longo", + author_email="chris.longo@gmail.com", + + packages=["httpshell"], + entry_points={'console_scripts': ['httpsh=httpshell.repl:main']}, + py_modules=["ez_setup"], + + install_requires=REQUIRES, + + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + 'Programming Language :: Python :: 2.4', + 'Programming Language :: Python :: 2.5', + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Topic :: System :: Networking" + ] +)