Skip to content

Making the shell embeddable #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions httpsh → httpshell/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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()

43 changes: 23 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
)