2012-08-18 23:03:31 +02:00
|
|
|
"""
|
|
|
|
Provides the `httpie' management command.
|
|
|
|
|
|
|
|
Note that the main `http' command points to `httpie.__main__.main()`.
|
|
|
|
|
|
|
|
"""
|
|
|
|
import argparse
|
|
|
|
|
|
|
|
from . import sessions
|
|
|
|
from . import __version__
|
|
|
|
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(
|
|
|
|
description='The HTTPie management command.',
|
|
|
|
version=__version__
|
|
|
|
)
|
|
|
|
subparsers = parser.add_subparsers()
|
|
|
|
|
|
|
|
|
|
|
|
# Only sessions as of now.
|
2012-08-19 04:58:14 +02:00
|
|
|
sessions.add_commands(subparsers)
|
2012-08-18 23:03:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
args = parser.parse_args()
|
2012-08-19 04:58:14 +02:00
|
|
|
args.command(args)
|
2012-08-18 23:03:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|